; Anniversary version, using a custom graphic logo stored in this BOOT ROM at $3000, after the old BOOT images.
; No dedication message implemented yet, this version can be used to generate a video/animated gif to post on website
; This is the final revision, designed to work with a 64K system ROM
; that has the CP/M code in the upper 16KB page (C000-FFFF).
; The NMI BASIC formerly placed there is now loaded by loading the
; standard Spectrum BASIC in DRAM0 and then injecting in it the NMI routine
; which is stored separately in the free space at the end of the upper
; 16KB system ROM page, after the CP/M code. Then 3 bytes are also modified
; starting at 0066 in the BASIC code.

; Lines that must be modified for different video memory address (for testing in Spectrum emulators)
; are numbered and marked with --------@@@ at the end (27 lines in total for Boot Manager itself + 70 for anniversary logo)
; Video memory starts at C000 for CoBra startup config (both 64K and 80K configs)
; and at 4000 for standard Spectrum (emulator to test this assembled code)

; Memory locations used for temporary storage of variables:
; $8000 = Current hardware config ($64 if 64K, $80 if 80K)
; $8080-$808F = checksum results for SYSTEM ROM area $0000-$3FFF
; $8090-$809F = checksum results for SYSTEM ROM area $4000-$7FFF
; $80A0-$80AF = checksum results for SYSTEM ROM area $8000-$BFFF
; $80B0-$80BF = checksum results for SYSTEM ROM area $C000-$FFFF

CBASE	EQU	$0400	; character definitions table, base address
			; (the first 32 (20h) chars are non printable
			; so we don't use them, therefore the space
			; between 0400-04FF can be used for code)
	ORG	$0000
	DI
	LD	A,$80
	LD	R,A	; set bit 7 of R to 1 -> PO to 1
	LD	SP,$0000 ; set stack at memory top
	CALL	DELAY	; a delay to allow 8255 to come out of reset
	CALL	DELAY	; a delay to allow 8255 to come out of reset
	LD      A,$03	;
	OUT     ($E3),A	; Reset
	OUT     ($EB),A	; and disable
	OUT     ($F3),A	; Z80-CTC
	OUT     ($FB),A	; channels.
	LD	A,$92	; Control word for 8255: Mode Set flag=active,
			;	Group A: Select Mode 0,
			;		 Port A set to Input mode,
			;		 Port C (upper half) set to Output Mode,
			;	Group B: Select Mode 0,
			;		 Port B set to Input Mode,
			;		 Port C (lower half) set to Output Mode
	OUT     ($DF),A	; Send control word to 8255
	LD      A,$40
	OUT     ($FE),A	; write 40h to port C of 8255
			; (border black, "SO" to 0, "O5" to 0,
			;  "O6" to 1 to allow access to video memory
			;  in the 80K hw startup config)
	JR	MAIN
			;############# LOAD SYSTEM FROM ROM #######
			; input: A=00 -> bit 3 (TO=A15) -> OPUS+BASIC/DEVIL+NMI
			;	 A=08 -> bit 7 (SO=A14) -> OPUS/BASIC DEVIL/NMI
			; for OPUS:  LD A,$00: CALL RS: LD A,$08: JP RS
			; for BASIC: LD A,$00: CALL RS: LD A,$08: JP ST
			; for DEVIL: LD A,$00: CALL ST: LD A,$08: JP RS
			; for NMI:   LD A,$00: CALL ST: LD A,$08: JP ST
RS	ADD	A,$06	; reset bit 3 (TO=A15=0) or 7 (SO=A14=0)
	JR	SOTO
ST	ADD	A,$07	;   set bit 3 (TO=A15=1) or 7 (SO=A14=1)
SOTO	CP	$08
	OUT	($DF),A
	RET	C	; return if bit 3 processed
SYS	LD	HL,$6000
	LD	DE,$E000
	LD	BC,$2000
	LDIR		; copy system code upper half in upper half DRAM#0 if 64K RAM
			;############# 80K BASIC CONFIG ########
			; This routine needs to be present at this address ($0038)
			; in the BOOT ROM, for Spectrum programs to be loaded from disk
			; and run in CP/M 80K with the standard "CP/M game loader".
	ORG	$0038
	LD      HL,$4000	; 4000 is the start addr of BASIC EPROM in the startup hw config
	LD      DE,$8000	; 8000 is the start addr of DRAM#0 in the startup hw config
	LD      BC,$4000	; 4000 is the length of the SPECTRUM BASIC code (16 KB)
	LDIR		; copy system code into DRAM#0 for 80K RAM
NMISYS	EXX		; HL' contains the final jump address
	LD      A,$03	;
	OUT     ($E3),A	;
	OUT     ($EB),A	;
	OUT     ($F3),A	;
	OUT     ($FB),A	;
	XOR     A	;
	OUT     ($FD),A	;
	OUT     ($FE),A	; write 03 to port C of 8255
			; (set border to white, SO=0, O5=0, O6=0)
	LD      R,A	; set bit 7 of R to 0, prepare for BASIC hardware configuration
	JP      (HL)	; change hardware configuration with a jump to (HL)

			; ############ MAIN CODE  ############

MAIN	CALL	ALOGO		; call anniversary routine
	LD      A,$40
	OUT     ($FE),A

			; ---------- DRAWING THE SCREEN ----------

	LD	HL,$8000 ; *1* video mem is at C000							 (80->40 @ ????) -------@@@
	LD	DE,$8001 ; *2* video mem is at C000							 (80->40 @ ????) -------@@@
	LD	BC,$7FFF ; *3*										 (7F->BF @ ????) -------@@@
	LD	(HL),0
	LDIR
	LD	HL,$D800 ; *4* attrs mem is at D800							 (D8->58 @ ????) -------@@@
	LD	DE,$D801 ; *5* attrs mem is at D800							 (D8->58 @ ????) -------@@@
	LD	BC,$300
	LD	(HL),$06 ; INK=yellow, PAPER=black
	LDIR
	LD	HL,$DAE0 ; *6* --- cfg info background							 (DA->5A @ ????) -------@@@
	LD	DE,$DAE1 ; *7*										 (DA->5A @ ????) -------@@@
	LD	BC,$19
	LD	(HL),$05 ; INK=yellow, PAPER=black
	LDIR
	LD	HL,$D842 ; *8* --- title background							 (D8->58 @ ????) -------@@@
	LD	DE,$D843 ; *9*										 (D8->58 @ ????) -------@@@
	LD	BC,$1B
	LD	(HL),$16 ; INK=yellow, PAPER=red
	LDIR
	LD	HL,$D8A2 ; *10* --- 64K section title bg						 (D8->58 @ ????) -------@@@
	LD	DE,$D8A3 ; *11*										 (D8->58 @ ????) -------@@@
	LD	BC,$0B
	LD	(HL),$1E ; INK=yellow, PAPER=magenta
	LDIR
	LD	HL,$D8B2 ; *12* --- 80K section title bg						 (D8->58 @ ????) -------@@@
	LD	DE,$D8B3 ; *13*										 (D8->58 @ ????) -------@@@
	LD	BC,$0B
	LD	(HL),$0E ; INK=yellow, PAPER=blue
	LDIR
	LD	HL,$1700 ; --- config info text
	LD	DE,M_9
	CALL	MSG_PR
			 ; ---------- START CONFIG DETECTION ----------
	LD	HL,MEM_T
	LD	DE,$E000 ; if 80K hw config, this s/b in the VRAM (for "O6"=1)
	LD	BC,$11
	LDIR		; copy signature test string to $E000
	LD	A,$00
	OUT     ($FE),A	; write 00h to port C of 8255
			; (set "O6" to 0, if we are in 80K config then at
			; E000 there s/b now DRAM#1 instead of VRAM)
	LD	DE,MEM_T
	LD	HL,$E000
	LD	BC,$11
SGV	LD	A,(DE)
	CPI
	JP	PO,C64K	; config is 64K if entire signature string identical
	JR	NZ,C80K	; config is 80K if anything is different
	INC	DE
	JR	SGV
C64K	LD	HL,$171C ; --- configuration 64K
	LD	DE,M_10
	CALL	MSG_PR
	LD	HL,$D900 ; *14* --- 64K section first item						 (D9->59 @ ????) -------@@@
	LD	DE,$D901 ; *15*										 (D9->59 @ ????) -------@@@
	LD	BC,$0E
	LD	(HL),$86 ; INK=yellow, PAPER=black, BLINK
	LDIR
	LD	HL,$DAFB ; *16* --- config background							 (DA->5A @ ????) -------@@@
	LD	DE,$DAFC ; *17*										 (DA->5A @ ????) -------@@@
	LD	BC,$04
	LD	(HL),$1E ; INK=yellow, PAPER=magenta
	LDIR
	LD	A,$64
	LD	($8000),A ; (store computer config info at 8000)
	LD	IX,(T_LC) ; position of top item in left column (color attr)
	LD	IY,$01
	LD      A,$03	; border magenta, "SO" to 0, "O5" to 0, "O6" to 0
	OUT     ($FE),A	; ("O6" to 1 not req'd for access to video memory
			; in the 64K hw startup config)
	JR	NXT5
C80K	LD      A,$41	; border blue, "SO" to 0, "O5" to 0,
	OUT     ($FE),A	; "O6" to 1 to allow access to video memory
			; in the 80K hw startup config
	LD	HL,$171C ; --- configuration 80K
	LD	DE,M_11
	CALL	MSG_PR
	LD	HL,$D911 ; *18* --- 80K section first item						 (D9->59 @ ????) -------@@@
	LD	DE,$D912 ; *19*										 (D9->59 @ ????) -------@@@
	LD	BC,$0E
	LD	(HL),$86 ; INK=yellow, PAPER=black, BLINK
	LDIR
	LD	HL,$DAFB ; *20* --- config background							 (DA->5A @ ????) -------@@@
	LD	DE,$DAFC ; *21*										 (DA->5A @ ????) -------@@@
	LD	BC,$04
	LD	(HL),$0E ; INK=yellow, PAPER=blue
	LDIR
	LD	A,$80
	LD	($8000),A ; (store computer config info at 8000)
	LD	IX,(T_RC) ; position of top item in right column (color attr)
	LD	IY,$11
			; ---------- END CONFIG DETECTION ----------

NXT5	LD	HL,$0204 ; title
	LD	DE,M_1
	CALL	MSG_PR
	LD	HL,$0503 ; 64K section header
	LD	DE,M_2
	CALL	MSG_PR
	LD	HL,$0513 ; 80K section header
	LD	DE,M_3
	CALL	MSG_PR
	LD	HL,$0801 ; std boot (64k)
	LD	DE,M_4
	CALL	MSG_PR
	LD	HL,$0812 ; std boot (80k)
	LD	DE,M_4
	CALL	MSG_PR
	LD	HL,$0A01 ; std test (64k)
	LD	DE,M_6
	CALL	MSG_PR
	LD	HL,$0A12 ; std test (80k)
	LD	DE,M_6
	CALL	MSG_PR
	LD	HL,$0C01 ; homok test (64k)
	LD	DE,M_7
	CALL	MSG_PR
	LD	HL,$0C12 ; mastery boot (80k)
	LD	DE,M_5
	CALL	MSG_PR
			; ---------- KEYBOARD READING ----------
			;
KBD	LD	A,($8000)
	CP	$80
	JR	NZ,NOCPM
	LD	A,$FE	; test row KA8
	IN	A,($FE)
	RLA
	RLA
	RLA		; test bit K5 (CTRL key)
	JR	C,NOCPM
	LD	A,$EF	; test row KA12
	IN	A,($FE)
	RRA		; test bit K0 (0 key)
	JP	NC,CPM0
	RRA		; test bit K1 (9 key)
	JP	NC,CPM1
	RRA		; test bit K2 (8 key)
	JP	NC,CPM2
	RRA		; test bit K3 (7 key)
	JP	NC,CPM3
NOCPM	LD	A,$7F	; test row KA15
	IN	A,($FE)
	RLA
	RLA
	RLA		; test bit K5 (F4 key)
	CALL	NC,CRC	; do system ROM checksums
			; ********** ROM LOADING B.N.O.D ***********
	RLA		; test bit K4 (B key)
	JR	NC,BASIC ; load Spectrum Basic
	RLA		; test bit K3 (N)
	JR	NC,NMI	; load Spectrum Basic with NMI routine
	LD	A,$DF	; test row KA13
	IN	A,($FE)
	RRA
	RRA		; test bit K1 (O key)
	JR	NC,OPUS	; load OPUS
	LD	A,$FD	; test row KA9
	IN	A,($FE)
	RRA
	RRA
	RRA		; test bit K2 (D key)
	JR	NC,DEVIL ; load DEVIL
			; ********** ROM LOADING 1,2,3,4 ***********
	LD	A,$F7	; test row KA11
	IN	A,($FE)
	RRA		; test bit K0 (1 key)
	JR	NC,OPUS
	RRA		; test bit K1 (2 key)
	JR	NC,BASIC
	RRA		; test bit K2 (3 key)
	JR	NC,DEVIL
	RRA		; test bit K3 (4 key)
	JR	NC,NMI
			; ******************************************
	LD	A,$BF	; test row KA14
	IN	A,($FE)
	RRA		; check bit K0 (ENTER key)
	CALL	NC,SEL	; select and run boot code
	LD	A,$FE	; test row KA8
	IN	A,($FE)
	RRA		; check bit K0 (Caps Shift)
	JR	C,KBD	; if CapsShift not pressed restart loop
	LD	A,$EF	; test row KA12
	IN	A,($FE)
	RLA
	RLA
	RLA
	RLA		; test bit K4 (key 6, down arrow)
	PUSH	AF
	CALL	NC,DOWN
	POP	AF
	RLA		; test bit K3 (key 7, up arrow)
	CALL	NC,UP
	JR	KBD	; ############ END MAIN CODE ############

			; ########## ROM SYSTEM LOADING #########
			; --------- using port C parallel load
;OPUS	LD	A,$00	; SO=0, TO=0
;	JR	LOAD
;BASIC	LD	A,$80	; SO=1, TO=0
;	JR	LOAD
;DEVIL	LD	A,$08	; SO=0, TO=1
;	JR	LOAD
;NMI	LD	A,$88	; SO=1, TO=1
;LOAD	OUT	($FE),A
;	LD	HL,$0000
;	EXX
;	JP	SYS
			; -------- using port C BSR Mode
OPUS	XOR	A
	CALL	RS
	JR	O_D
BASIC	XOR	A
	CALL	RS
	JR	B_N
DEVIL	XOR	A
	CALL	ST
O_D	LD	A,$08
	LD	HL,$0000
	EXX
	JP	RS
B_N	LD	A,$08
	LD	HL,$0000
	EXX
	JP	ST
		; Routine for NMI BASIC loading using a 64K SYSTEM ROM	
		; that has CP/M (12800 bytes) + NMI code in the last quarter
		; (C000-FFFF, where NMI BASIC used to be)
		; The NMI BASIC is now loaded by loading the regular BASIC
		; and then injecting the NMI code on top of it.
NMI	LD	A,$80
	OUT	($FE),A	; same as BASIC, set bit 7 (SO=A14=1) and reset bit 3 (TO=A15=0)
	LD	HL,$0000
	EXX
SYS1	LD	HL,$6000
	LD	DE,$E000
	LD	BC,$2000
	LDIR		; copy system code upper half in upper half DRAM#0 if 64K RAM
			;############# 80K BASIC CONFIG #############
	LD      HL,$4000	; 4000 is the start addr of BASIC EPROM in the startup hw config
	LD      DE,$8000	; 8000 is the start addr of DRAM#0 in the startup hw config
	LD      BC,$4000	; 4000 is the length of the SPECTRUM BASIC code (16 KB)
	LDIR		; copy system code into DRAM#0 for 80K RAM
			; ############ NMI CODE INJECTION ###########
	LD	A,$88	; SO=1, TO=1, access the CP/M ROM page
	OUT	($FE),A
	LD	HL,$720F	; NMI code address in the CP/M ROM page
	LD	DE,$F86F	; NMI code injection start address in 64K config
	LD	BC,$013C	; NMI code length
	LDIR
	LD	HL,$720F	; NMI code address in the CP/M ROM page
	LD	DE,$B86F	; NMI code injection start address in 80K config
	LD	BC,$013C	; NMI code length
	LDIR
	LD	HL,$8066	; \
	LD	(HL),$C3	;  \ modify 3 bytes at $0066 in BASIC
	LD	HL,$3880	;  / to call the NMI code injected
	LD	($8067),HL	; /
	JP	NMISYS		; jump to already existing copy of code below (to save space)
;	EXX		; HL' contains the final jump address
;	LD      A,$03	;
;	OUT     ($E3),A	;
;	OUT     ($EB),A	;
;	OUT     ($F3),A	;
;	OUT     ($FB),A	;
;	XOR     A	;
;	OUT     ($FD),A	;
;	OUT     ($FE),A	; write 03 to port C of 8255
;			; (set border to white, SO=0, O5=0, O6=0)
;	LD      R,A	; set bit 7 of R to 0, prepare for BASIC hardware configuration
;	JP      (HL)	; change hardware configuration with a jump to (HL)
			;
			; ######### CP/M ROM LOADING #########
CPM0	LD	A,$00	; default drive 0
	JR	CPM
CPM1	LD	A,$01	; default drive 1
	JR	CPM
CPM2	LD	A,$02	; default drive 2
	JR	CPM
CPM3	LD	A,$03	; default drive 3
CPM	LD	B,$8A	; bit2=1 (BORDER=RED), bit3=TO=A15=1 and bit7=SO=A14=1 to select 16K SYSTEM ROM with CPM
	LD	C,$FE	; port C address
	OUT	(C),B	; set
	LD	HL,$4000
	LD	DE,$8000
	LD	BC,$3200
	LDIR
	LD	HL,$8004 ; DSK Byte, location used as mailbox from BOOT to CP/M for user choice of default drive
	LD	(HL),A	; set default CP/M logical drive
	LD	HL,$0000 ; jump address in upcoming CP/M config
	LD	A,$40
	OUT	($FE),A	; set O6=1 for CP/M config
	XOR	A
	LD	R,A
	JP	(HL)
			; ############ CHAR_PRINT ############
			; INPUTS:
			; H = row to print character (0-23)
			; L = column to print character (0-31)
			; C = character code to print
CHR_PR	PUSH	HL
	PUSH	DE
	PUSH	BC
	PUSH	AF
	LD	DE,0	; DE = final screen mem addr
	LD	A,H
	LD	B,3
L1	SRL	A	; 0 -> A ->CY
	RR	E	; CY -> E -> CY
	DJNZ	L1	; row nr in bits 7,6,5 of E
	LD	A,E
	ADD	A,L	; add E to L
	LD	E,A	; store result in E  ##### lower final screen addr
	LD	A,H
	OR	$C0	; *22* video mem is at C000								 (C0->40 @ ????) -------@@@
	AND	$F8	; reset lower 3 bits
	LD	D,A	; store result in D  ##### upper final screen addr
	LD	HL,CBASE ; character definitions base addr
	LD	B,0	; BC = character to print on 16 bit
	RL	B	; reset CY
	RL	C	; ] multiply
	RL	B	; ] contents of BC
	RL	C	;
	RL	B	;
	RL	C	;
	RL	B	; ] by 8
	ADD	HL,BC	; HL = char addr in char table
	LD	B,8	; counter for 8 lines TV of a char
L2	LD	A,(HL)	;\
	LD	(DE),A	; | print
	INC	HL	; | the
	INC	D	; | character
	DJNZ	L2	;/
	POP	AF
	POP	BC
	POP	DE
	POP	HL
	RET
			; ############ MSG PRINT ############
			; INPUTS:
			; H = start row to print message (0-23)
			; L = start column to print message (0-31)
			; DE = message start address (ends with $00)
MSG_PR	LD	A,(DE)
	LD	C,A
	LD	A,0
	CP	C
	RET	Z	; return if char code is 0
	LD	A,$1F
	CP	L
	RET	M	; return if out of screen
	CALL	CHR_PR
	INC	L
	INC	DE
	JR	MSG_PR
			; ######## KEYBOARD NON-PRESSED TEST ########
KEY_NP	LD	A,$FE	; test row KA8
	IN	A,($FE)
	AND	$3F
	CP	$3F	; check if any key pressed
	JR	NZ,KEY_NP	; if any key  still pressed read kbd again
	LD	A,$EF	; test row KA12
	IN	A,($FE)
	AND	$3F
	CP	$3F	; check if any key pressed
	JR	NZ,KEY_NP	; if any key still pressed, read kbd again
	LD	B,$03
DL1	CALL	DELAY
	DJNZ	DL1
	RET

			; ########## HEX2ASCII #########
			; INPUTS:
			; A = byte to print as ASCII hex digits
			; OUTPUTS:
			; B = upper digit ascii
			; C = lower digit ascii
H2A	LD	B,A
	SRL	B
	SRL	B
	SRL	B
	SRL	B	; B=upper digit
	AND	$0F
	LD	C,A	; C=lower digit

	LD	A,B
	CALL	TRAN
	LD	B,A	; B=upper hex digit as ascii
	LD	A,C
	CALL	TRAN
	LD	C,A	; B=lower hex digit as ascii

	RET
			; ###### translate 4-bit hex digit in A into ASCII value
TRAN	CP	$0A	; if A=00...09
	JR	C,NXT3	; skip next line
	ADD	A,$07
NXT3	ADD	A,$30	; A=ascii index
	RET

			; ########## HEXPRINT ##########
			; INPUTS:
			; H = row to print character (0-23)
			; L = column to print character (0-31)
			; B = upper digit ascii
			; C = lower digit ascii
HEX_PR	LD	A,C
	LD	C,B
	CALL	CHR_PR
	INC	L
	LD	C,A
	CALL	CHR_PR
	INC	L
	RET

			; ######### CHECKSUM PROCEDURE #########
			; INPUTS:
			; IX = storage start addr for checksums (2 bytes per 2KB checked)
CHS	PUSH	AF
	PUSH	BC
	PUSH	DE
	PUSH	HL
	EXX
	PUSH	AF
	PUSH	BC
	PUSH	DE
	PUSH	HL
	EXX

;	LD      IX,$8080 ; storage addr for checksums
	LD      B,$08	; loop counter
	LD      HL,$4000 ; BASIC ROM start addr (HL=mem pointer)
L2K	PUSH    BC	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <---|
	LD      DE,$0800 ;							|
	EXX		; *****							|
	LD      HL,$0000 ; HL'=0000 to start, HL' stores CRC value		|
	EXX		; *****							|
LCH1	LD      A,(HL)	; <--- <--- <--- <--- <--- <----| read from (4000)	|
	EXX		; *****				|			|
	LD      B,$08	; loop counter			|			|
	LD      C,A	; C=data byte			|			|
LCH2	RLC     C	; CY = bit 7<--- <--- <---|	|			|
	SBC     A,A	; A=00-CY		  |	|			|
	LD      E,A	; E=00(bit7=0) or FF	  |	|			|
	LD      A,L	; (loop starts w L'=00)   |	|			|
	AND     $40	;			  |	|			|
	SUB     $01	;			  |	|			|
	SBC     A,A	; A=00(Lbit6=1) or FF	  |	|			|
	XOR     E	;			  |	|			|
	LD      E,A	; E=00 if bit7!=Lbit6	  |	|			|
	LD      A,H	; (loop starts w H'=00)   |	|			|
	AND     $01	;			  |	|			|
	SUB     $01	;			  |	|			|
	SBC     A,A	; A=00(Hbit1=1) or FF	  |	|			|
	XOR     E	;			  |	|			|
	LD      E,A	; E=00 if [(Hbit1=1)&(bit7!=Lbit6)]||[(Hbit1=0)&(bit7=Lbit6)]
	LD      A,H	;			  |	|			|
	AND     $08	;			  |	|			|
	SUB     $01	;			  |	|			|
	SBC     A,A	; A=00(Hbit3=1) or FF	  |	|			|
	XOR     E	;			  |	|			|
	LD      E,A	;			  |	|			|
	LD      A,H	;			  |	|			|
	AND     $80	;			  |	|			|
	SUB     $01	;			  |	|			|
	SBC     A,A	; A=00(Hbit7=1) or FF	  |	|			|
	XOR     E	;			  |	|			|
	RLCA		;			  |	|			|
	RL      L	;			  |	|			|
	RL      H	;			  |	|			|
	DJNZ    LCH2	; ---> 8 loops -----> --->|	|			|
	EXX		; *****				|			|
	INC     HL	; increment mem pointer		|			|
	DEC     DE	; decrement loop counter	|			|
	LD      A,D	;\ test if			|			|
	OR      E	;/ DE=0000			|			|
	JR      NZ,LCH1	; ---> ---> 800h loops ---> --->|			|
	EXX		; *****							|
	LD	(IX+0),H ; store high byte of checksum				|
	LD	(IX+1),L ; store low byte of checksum				|

	PUSH	AF
	PUSH	BC
	LD	HL,($8002)
	LD	A,(IX+0)
	CALL	H2A
	CALL	HEX_PR
	LD	A,(IX+1)
	CALL	H2A
	CALL	HEX_PR
	LD	($8002),HL
	POP	BC
	POP	AF

	INC	IX	;							|
	INC	IX	;							|
	EXX		; *****							|
	POP     BC	; B = loop counter					|
	DJNZ    L2K	; ---> 8 loops -----> ---> ---> ---> ---> ---> ---> --->|

	EXX
	POP     HL
	POP	DE
	POP	BC
	POP	AF
	EXX
	POP     HL
	POP	DE
	POP	BC
	POP	AF

	RET
			; ########### CHECKSUMS ##########
CRC	PUSH	AF
	PUSH	BC
	PUSH	IX

	LD	HL,$1000 ; ROM checksum message
	LD	DE,M_12
	CALL	MSG_PR

	LD	IX,$8080
	LD	A,($8000)
	CP	$64
	JR	Z,CKS1
	LD	B,$41	; TO=0,SO=0 select ROM 0000-3FFF (80K config)
	JR	CKS2
CKS1	LD	B,$43	; TO=0,SO=0 select ROM 0000-3FFF (64K config)

CKS2	LD	HL,$1017 ; address range being checksumed, 0000-3FFF
	LD	DE,M_13
	CALL	MSG_PR
	LD	HL,$1200
	LD	($8002),HL
	CALL	DO1	; do checksums for ROM 0000-3FFF, store at 8080-808F
	SET	7,B	; TO=0,SO=1 select ROM 4000-7FFF
	LD	HL,$1017 ; address range being checksumed, 4000-7FFF
	LD	DE,M_14
	CALL	MSG_PR
	LD	HL,$1300
	LD	($8002),HL
	CALL	DO1	; do checksums for ROM 4000-7FFF, store at 8090-809F
	RES	7,B
	SET	3,B	; TO=1,SO=0 select ROM 8000-BFFF
	LD	HL,$1017 ; address range being checksumed, 8000-BFFF
	LD	DE,M_15
	CALL	MSG_PR
	LD	HL,$1400
	LD	($8002),HL
	CALL	DO1	; do checksums for ROM 8000-BFFF, store at 80A0-80AF
	SET	7,B	; TO=1,SO=1 select ROM C000-FFFF
	LD	HL,$1017 ; address range being checksumed, C000-FFFF
	LD	DE,M_16
	CALL	MSG_PR
	LD	HL,$1500
	LD	($8002),HL
	CALL	DO1	; do checksums for ROM 8000-BFFF, store at 80B0-80BF
			; ---------- erase current range -----------
	LD	HL,$1017 ; address range being checksumed, C000-FFFF
	LD	DE,M_18
	CALL	MSG_PR
			; ---------- highlight groups of 4 digits ----------
	LD	HL,M_13	; smart reuse of already available data
	LD	BC,$04
	LD	DE,$DA44 ; *23*										 (DA->5A @ ????) -------@@@
	EXX
	LD	B,$10
REP1	EXX
	PUSH	HL
	PUSH	BC
	LDIR
	POP	BC
	POP	HL
	INC	DE
	INC	DE
	INC	DE
	INC	DE
	EXX
	DJNZ	REP1
	EXX	
			; --------------------------------------------------
	POP	IX
	POP	BC
	POP	AF
	RET
			; this routine moved below inside char definitions table to make room for more code
;DO1	PUSH	BC	; backup current ROM zone selection
;	LD	A,B
;	OUT	($FE),A
;	CALL	CHS	; checksums for ROM 0000-4000 stored at 8080-808F
;	POP	BC	; restore current ROM zone selection
;	RET

			; ####### MOVE SELECTION UP ######
UP	CALL	KEY_NP
	PUSH	IX
	LD	A,($8000)
	CP	$64
	LD	HL,T_LC
	JR	Z,NXT6
	LD	HL,T_RC
NXT6	POP	BC
	LD	A,C
	CP	(HL)	; compare low byte of T_LC
	JR	NZ,NXT1 ; skip fwd if diff
	INC	HL
	LD	A,B
	CP	(HL)	; compare high byte of T_LC
	RET	Z	; if already on top item, exit
NXT1	PUSH	IX
	POP	HL
	LD	D,H
	LD	E,L
	INC	DE
	LD	BC,$0E
	LD	(HL),$06 ; INK=yellow, PAPER=black, BLINK=OFF
	LDIR		; turn BLINK OFF
	PUSH	IX
	POP	HL
	LD	A,(R_I)
	LD	DE,0
	LD	E,A
	RLC	D	; reset CY
	SBC	HL,DE
	PUSH	HL
	POP	IX	; update IX with current pos of selected item
	DEC	IY
	LD	D,H
	LD	E,L
	INC	DE
	LD	BC,$0E
	LD	(HL),$86 ; INK=yellow, PAPER=black, BLINK
	LDIR		; turn BLINK ON
	RET
	
			; ####### MOVE SELECTION DOWN ######
DOWN	CALL	KEY_NP
	PUSH	IX
	LD	A,($8000)
	CP	$64
	LD	HL,B_LC
	JR	Z,NXT7
	LD	HL,B_RC
NXT7	POP	BC
	LD	A,C
	CP	(HL)	; compare low byte of B_LC
	JR	NZ,NXT2 ; skip fwd if diff
	INC	HL
	LD	A,B
	CP	(HL)	; compare high byte of B_LC
	RET	Z	; if already on bottom item, exit
NXT2	PUSH	IX
	POP	HL
	LD	D,H
	LD	E,L
	INC	DE
	LD	BC,$0E
	LD	(HL),$06 ; INK=yellow, PAPER=black, BLINK=OFF
	LDIR		; turn BLINK OFF
	PUSH	IX
	POP	HL
	LD	A,(R_I)
	LD	DE,0
	LD	E,A
	ADD	HL,DE
	PUSH	HL
	POP	IX	; update IX with current pos of selected item
	INC	IY
	LD	D,H
	LD	E,L
	INC	DE
	LD	BC,$0E
	LD	(HL),$86 ; INK=yellow, PAPER=black, BLINK
	LDIR		; turn BLINK ON
	RET
			; ########### BOOT SELECT ########
SEL	PUSH	BC	; backup BC
	PUSH	IY
	POP	BC
	LD	A,C
	CP	$01
	JP	Z,BOOT64
	CP	$02
	JP	Z,TEST64
	CP	$03
	JP	Z,HOMOK
	CP	$11
	JP	Z,BOOT80
	CP	$12
	JP	Z,TEST64
	CP	$13
	JP	Z,MASTY
	POP	BC	; restore BC
	RET
BOOT64	EQU	$0800	; address of standard 64K boot
BOOT80	EQU	$1000	; address of standard 80K boot
HOMOK	EQU	$1800	; address of HOMOK test (64K)
TEST64	EQU	$2000	; address of STD test (64K)
MASTY	EQU	$2800	; address of MASTERY boot (80K)

			; ########### CHARACTER DEFINITIONS ###########
	ORG	$500
C_SP	DEFB	0,0,0,0,0,0,0,0

	ORG	$508	; to save space, this little routine is placed between the SPACE and APOSTROPHE char definitions
DELAY	EXX
	LD	BC,$1FFF
	LD	DE,$9001
	LD	HL,$9000
	LD	(HL),0
	LDIR
	EXX
	RET

	ORG	$518
C_STAR0	DEFB	$00,$00,$00,$00,$10,$00,$00,$00		; char code in hex is $23
C_STAR1	DEFB	$00,$00,$00,$10,$38,$10,$00,$00		; char code in hex is $24
C_STAR2	DEFB	$00,$00,$10,$10,$38,$10,$10,$00		; char code in hex is $25
C_STAR3	DEFB	$00,$10,$10,$38,$FE,$38,$10,$10		; char code in hex is $26

	ORG	$538
C_APST	DEFB	$18,$18,$10,$00,$00,$00,$00,0

	ORG	$540
DO1	PUSH	BC	; backup current ROM zone selection
	LD	A,B
	OUT	($FE),A
	CALL	CHS	; checksums for ROM 0000-4000 stored at 8080-808F
	POP	BC	; restore current ROM zone selection
	RET

	ORG	$568
C_MINUS	DEFB	$00,$00,$00,$7E,$7E,$00,$00
	DEFB	0

	ORG	$580
C_0	DEFB	$3C,$42,$46,$6A,$72,$62,$3C
	DEFB	0
C_1	DEFB	$18,$30,$50,$18,$18,$18,$18
	DEFB	0
C_2	DEFB	$3C,$42,$02,$1C,$70,$60,$7E
	DEFB	0
C_3	DEFB	$3C,$42,$02,$1C,$06,$46,$3C
	DEFB	0
C_4	DEFB	$40,$40,$48,$7E,$0C,$0C,$0C
	DEFB	0
C_5	DEFB	$7C,$60,$60,$7C,$02,$02,$7C
	DEFB	0
C_6	DEFB	$3C,$42,$40,$7C,$62,$62,$3C
	DEFB	0
C_7	DEFB	$7E,$02,$02,$0E,$1C,$38,$70
	DEFB	0
C_8	DEFB	$3C,$62,$62,$3C,$62,$62,$3C
	DEFB	0
C_9	DEFB	$3C,$62,$62,$3E,$02,$62,$3C
	DEFB	0

	ORG	$5D0
C_COLN	DEFB	$00,$18,$18,$00,$18,$18,$00
	DEFB	0

	ORG	$5D8
DELAY1	EXX		; to save space, this little routine is placed between the COLON and A char definitions (chars in between are not used)
	LD	BC,$0500
	LD	DE,$9001
	LD	HL,$9000
	LD	(HL),0
	LDIR
	EXX
	RET
DELAY2	EXX		; to save space, this little routine is placed between the COLON and A char definitions (chars in between are not used)
	LD	BC,$05E0
	LD	DE,$9001
	LD	HL,$9000
	LD	(HL),0
	LDIR
	EXX
	RET

	ORG	$608
C_A	DEFB	$3C,$42,$42,$62,$7E,$62,$62
	DEFB	0
C_B	DEFB	$7C,$42,$42,$7C,$62,$62,$7C
	DEFB	0
C_C	DEFB	$3C,$42,$40,$60,$60,$62,$3C
	DEFB	0
C_D	DEFB	$7C,$42,$42,$62,$62,$62,$7C
	DEFB	0
C_E	DEFB	$7E,$40,$40,$78,$60,$60,$7E
	DEFB	0
C_F	DEFB	$7E,$40,$40,$7C,$60,$60,$60
	DEFB	0
C_G	DEFB	$3C,$42,$40,$60,$6E,$66,$3C
	DEFB	0
C_H	DEFB	$42,$42,$42,$7E,$62,$62,$62
	DEFB	0
C_I	DEFB	$3C,$10,$10,$18,$18,$18,$3C
	DEFB	0
C_J	DEFB	$1E,$04,$04,$0C,$6C,$6C,$38
	DEFB	0
C_K	DEFB	$46,$44,$48,$70,$68,$64,$66
	DEFB	0
C_L	DEFB	$40,$40,$40,$60,$60,$60,$7E
	DEFB	0
C_M	DEFB	$42,$66,$5E,$6A,$62,$62,$62
	DEFB	0
C_N	DEFB	$42,$62,$52,$6A,$66,$62,$62
	DEFB	0
C_O	DEFB	$3C,$42,$42,$62,$62,$62,$3C
	DEFB	0
C_P	DEFB	$7C,$42,$42,$62,$7C,$60,$60
	DEFB	0
C_Q	DEFB	$3C,$42,$42,$62,$6A,$64,$3A
	DEFB	0
C_R	DEFB	$7C,$42,$42,$62,$7C,$6C,$66
	DEFB	0
C_S	DEFB	$3C,$62,$60,$3C,$02,$62,$3C
	DEFB	0
C_T	DEFB	$7E,$10,$10,$18,$18,$18,$18
	DEFB	0
C_U	DEFB	$42,$42,$42,$62,$62,$62,$3C
	DEFB	0
C_V	DEFB	$42,$42,$42,$62,$62,$34,$18
	DEFB	0
C_W	DEFB	$42,$42,$4A,$6A,$6A,$76,$24
	DEFB	0
C_X	DEFB	$62,$62,$34,$08,$34,$62,$62
	DEFB	0
C_Y	DEFB	$42,$42,$42,$24,$18,$18,$18
	DEFB	0
C_Z	DEFB	$7E,$04,$08,$10,$20,$60,$7E
	DEFB	0

			; ########### MESSAGES ###########
	ORG	$700
M_1	DEFM	"COBRA BOOT CODE SELECTOR"
	DEFB	0
M_2	DEFM	"64K CONFIG"
	DEFB	0
M_3	DEFM	"80K CONFIG"
	DEFB	0
M_4	DEFM	"STANDARD BOOT"
	DEFB	0
M_5	DEFM	"MASTERY BOOT"
	DEFB	0
M_6	DEFM	"STANDARD TEST"
	DEFB	0
M_7	DEFM	"HOMOK TEST"
	DEFB	0
M_8	DEFM	"MODIFIED BOOT"
	DEFB	0
M_9	DEFM	"CURRENT CONFIG IS:"
	DEFB	0
M_10	DEFM	"64K"
	DEFB	0
M_11	DEFM	"80K"
	DEFB	0
M_12	DEFM	"SYSTEM ROM CHECKSUM:"
	DEFB	0
M_13	DEFM	"0000-3FFF"
	DEFB	0
M_14	DEFM	"4000-7FFF"
	DEFB	0
M_15	DEFM	"8000-BFFF"
	DEFB	0
M_16	DEFM	"C000-FFFF"
	DEFB	0
M_17	DEFM	"BOOT ROM CHECKSUM:"
	DEFB	0
M_18	DEFM	"         "
	DEFB	0

			; ########### MEMORY TEST SIGNATURE ###########
MEM_T	DEFM	"*COBRA*HW*CFG*DT*"

			; ########### SCREEN POSITIONS ##########
T_LC	DEFW	$D900	; *24* top item left column (color attr start)					 (D9->59 @ ????) -------@@@
T_RC	DEFW	$D911	; *25* top item right column (color attr start)					 (D9->59 @ ????) -------@@@
			; ***** these are values for 4 items per menu *****
;B_LC	DEFW	$D9C0	; *26* bottom item left column (color attr start)				 (D9->59 @ ????) -------@@@
;B_RC	DEFW	$D9D1	; *27* bottom item right column (color attr start)				 (D9->59 @ ????) -------@@@
			; ***** these are values for 3 items per menu *****
B_LC	DEFW	$D980	; *26* bottom item left column (color attr start)				 (D9->59 @ ????) -------@@@
B_RC	DEFW	$D991	; *27* bottom item right column (color attr start)				 (D9->59 @ ????) -------@@@
R_I	DEFB	$40	; row interval (color attr addr diff)

;			################################ ANNIVERSARY COBRA LOGO #######################################

; Lines that must be modified for different video memory address (for testing in Spectrum emulators)
; are numbered and marked with --------@@@ at the end (70 lines in total for anniversary logo)
; Video memory starts at C000 for CoBra startup config (both 64K and 80K configs)
; and at 4000 for standard Spectrum (emulator to test this assembled code)

	ORG	$3000		; This is $3000 in the BOOT ROM where we still have unused space after the original 2K BOOTs
ALOGO	DI
;			######## COBRA GRAPHIC LOGO ###########

	LD	HL,$C000	; *1* video mem is at C000						 (C0->40 @ 0093) -------@@@
	LD	DE,$C001	; *2* video mem is at C000						 (C0->40 @ 0093) -------@@@
	LD	BC,$1AFF
	LD	(HL),0
	LDIR
;
	LD      HL,$D900	; *3* video attr start addr for 2nd third of video RAM in startup hw cfg (D9->59 @ 0093) -------@@@
	LD      B,$08
L0096	PUSH    BC
	LD      BC,$0C05	; write "05" as color attribute
L009A	LD      (HL),C		; for the first 12 characters
	INC     HL		; of the middle third in the
	DJNZ    L009A		; Spectrum screen (INK=cyan, PAPER=black)
	LD      BC,$1403	; write "03" as color attribute
L00A1	LD      (HL),C		; for the next 20 characters
	INC     HL		; (INK==white, PAPER=black)
	DJNZ    L00A1		; so in total 32 characters (one line)
	POP     BC
	DJNZ    L0096	; repeat the above 7 times,(all 8 lines in the middle third of screen)
	EXX
	LD      HL,L0188	; HL' used as pointer to data block start address (0188)
	EXX
	LD      HL,$CBB9	; *4* address within serial video RAM, middle third of screen (CB->4B @ 00AF)		 -------@@@
	LD      DE,$01FE	; data to be written in there
	LD      A,$04
	LD      B,$09
L00B7	PUSH    BC	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <---
	LD      B,A	;						  |
L00B9	LD      (HL),D	; write "01" at CBB9 <--- <--- <- <--- <-|	  |
	INC     HL	;				|	 |	  |
	LD      (HL),E	; write "FE" at CBBA		|	 |	  |
	EXX		;				|	 |	  |
	LD      A,(HL)	; read first byte of data (FF)	|	 |	  |
	INC     HL	; increment pointer (HL'=0189)	|	 |	  |
	EXX		;				|	 |	  |
	LD      C,A	; C = data byte			|	 |	  |
	ADD     A,L	; A = data byte + L = B9 + CY	|	 |	  |
	LD      L,A	; L = data byte + L		|	 |	  |
	JR      NC,L00C6 ;				|	 |	  |
	INC     H	; H=CB+1=CC			|	 |	  |
L00C6	DJNZ    L00B9	; ---> ---> ---> ---> ---> --->>>	 |	  |
	LD      B,C	;					 |	  |
	EXX		;					 |	  |
	LD      E,(HL)	; Read 2 bytes				 |	  |
	INC     HL	; of data into				 |	  |
	LD      D,(HL)	; DE' register.				 |	  |
	INC     HL	; Increment pointer			 |	  |
	PUSH    DE	;					 |	  |
	EXX		;					 |	  |
	POP     HL	; HL = 2 data bytes			 |	  |
	SLA     E	;					 |	  |
	RL      D	;					 |	  |
	JR      NC,L00B9 ; ---> ---> ---> ---> ---> ---> ---> --->	  |
	RR      D	;						  |
	RR      E	;						  |
	LD      D,$FF	;						  |
L00DD	SLA     D	; <----						  |
	RL      E	;     |						  |
	JR      C,L00DD	; ---->						  |
	LD      A,D	;						  |
	CPL		;						  |
	LD      D,A	;						  |
	LD      E,$FF	;						  |
	LD      A,C	;						  |
	POP     BC	;						  |
	DJNZ    L00B7	; ---> ---> ---> ---> ---> ---> ---> ---> ---> --->
	LD      E,L
	LD      D,H
	EXX
	PUSH    HL
	EXX
	POP     HL
	LD      B,$0B
L00F4	PUSH    BC	; <--- <---
	LD      B,A	;	  |
	LD      A,(HL)	;	  |
	INC     HL	;	  |
L00F8	LD      (DE),A	; <----   |
	INC     DE	;     |   |
	DJNZ    L00F8	; ---->   |
	LD      A,(HL)	;	  |
	INC     HL	;	  |
	LD      E,(HL)	;	  |
	INC     HL	;	  |
	LD      D,(HL)	;	  |
	INC     HL	;	  |
	POP     BC	;	  |
	DJNZ    L00F4	; ---> --->
	LD      HL,L03E0	; addr of color attr for color pattern under logo (within data block)
	LD      DE,$DA8C	; *5* addr of color attr for color pattern under logo (within video mem) (DA->5A @ ????) -------@@@
	LD      BC,$0008	; length of color pattern under logo
	LDIR
	JP	START

			; ######### VERTICAL SCROLL FOR ANNIVERSARY COBRA LOGO (to move it into the middle 1/3 screen) #########

				; This routine is supposed to scroll the bottom 1/3 of screen
				; up into the middle 1/3, 1 pixel line at a time, not including color attrs

VSCR2	LD	IX, $C800	; *6* start of video region to shift (anniv CoBra logo)			 (C8->48 @ ????) -------@@@
	LD	($8000), IX	; store parameter at $8000
	LD	IX, $D000	; *7* middle point of video region to shift (anniv CoBra logo)		 (D0->50 @ ????) -------@@@
	LD	($8002), IX	; store parameter at $8002
;	LD	IX, $D900	; *8* start of attrs of video region to shift (anniv CoBra logo)	 (D9->59 @ ????) #------@@@
;	LD	($8004), IX	; store parameter at $8004
	LD	IX, $8006	; addr of parameter dictating if we scroll color attrs too
	LD	(IX+0), $00	; $FF - scroll attrs, $00 - don't scroll attrs
	JR	VSCR

			; ######### VERTICAL SCROLL FOR ORIGINAL COBRA LOGO (to move it into the upper 1/3 screen) #########

				; This routine is supposed to scroll the middle 1/3 of screen
				; up into the top 1/3, 1 pixel line at a time, including color attrs

VSCR1	LD	IX, $C000	; *9* start of video region to shift (orig CoBra logo)			 (C0->40 @ ????) -------@@@
	LD	($8000), IX	; store parameter at $8000
	LD	IX, $C800	; *10* middle point of video region to shift (orig CoBra logo)		 (C8->48 @ ????) -------@@@
	LD	($8002), IX	; store parameter at $8002
	LD	IX, $D800	; *11* start of attrs of video region to shift (orig CoBra logo)	 (D8->58 @ ????) -------@@@
	LD	($8004), IX	; store parameter at $8004
	LD	IX, $8006	; addr of parameter dictating if we scroll color attrs too
	LD	(IX+0), $FF	; $FF - scroll attrs, $00 - don't scroll attrs

VSCR	LD	HL, $0040	; total pixel line shift counter
	PUSH	HL

	EX	AF, AF'
SHFS	LD	A,  $10		; 16 char rows to shift up by 1 pix
	EX	AF, AF'
	LD	DE, ($8000)	; first parameter to this routine, start of scrolled serial video
	PUSH	DE		; *** INITIALIZE (top pix line of first char row)
	LD	HL, ($8000)	; first parameter to this routine, start of scrolled serial video
	LD	BC, $100
	ADD	HL, BC		; start of scrolled serial video + $100 (second pixel line)

CH2	LD	A,  $07		; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <---|
CH1	LD	BC, $0020	; <--- <--- <--- <--- <--- <--- <--- <--- <-----|	|
	LDIR			;						|	|
	LD	BC, $00E0	;						|	|
	ADD	HL, BC		;						|	|
	EX	DE, HL		;	current char row being shifted		|	|
	ADD	HL, BC		;						|	|
	EX	DE, HL		;						|	|
	DEC	A		;						|	|
	JR	NZ, CH1		; shift current char row 1 px up  ---> ---> --->|	|

	EX	AF, AF'		;							|
	DEC	A		; was this the last char row to shift?			|
	JR	Z, SHFE		;							|
;	EX	AF, AF'		;							|

	PUSH	DE		; start of  last pix line in last char row processed	|

	EXX			;							|
	POP	DE		; start of  last pix line in last char row processed	|
	POP	HL		; *** RESTORE (top pix line of prev char row)		|
	LD	BC, $0020	;							|
	ADD	HL, BC		; start of top pix line in next char row		|
;	EX	AF, AF'		;							|
	CP	$08		; end of top 1/3?					|
	JR	NZ, S2
	LD	HL, ($8002)	; start of first pix line in second 1/3			|
S2	PUSH	HL		; *** UPDATE (to top pix line in next char row)		|
	PUSH	HL		;							|
	LDIR			; pix line carry betw char rows				|
	EXX			;							|
	EX	AF, AF'		;							|

	POP	DE		; top pix line in next char row				|
	LD	H, D		;							|
	LD	L, E		;							|
	LD	BC, $0100	;							|
	ADD	HL, BC		; 2nd pix line in next char row				|
	JR	CH2		; restart shifting next char row  ---> ---> ---> ---> ->|
SHFE	EX	AF, AF'
	POP	DE		; balance stack between shift cycles

	EXX
	POP	HL		; total pixel line shift counter
	DEC	L
	JR	Z, EOSH
	PUSH	HL		; update total pixel shift counter
	BIT	0, L		; test if multiple of 8
	JR	NZ, S1
	BIT	1, L
	JR	NZ, S1
	BIT	2, L
	JR	Z, S1
	LD	IX, $8006	; addr of parameter dictating if we scroll color attrs too
	RLC	(IX+0)		; test if we scroll attrs or not
	JR	NC, S1		; skip scrolling if ($8006)=$00
	LD	DE, ($8004)
	LD	HL, ($8004)
	LD	BC, $0020
	ADD	HL, BC
	LD	BC, $01E0	; size of attr data to shift
	LDIR			; shift color attr one row up
S1	EXX
	JR	SHFS

EOSH	EXX
	RET

			; ######### ANNIVERSARY LOGO ROUTINE #######################################

ANNIV	LD	HL, $DA00	; *12* 									 (DA->5A @ ????) -------@@@
	LD	DE, $DA01	; *13* 									 (DA->5A @ ????) -------@@@
	LD	BC, $FF
	LD	(HL), 0
	LDIR			; blank the bottom 1/3 screen by clearing video attrs (serial data will be invisible)
	LD	HL, $C800	; *14* 									 (C8->48 @ ????) -------@@@
	LD	DE, $C801	; *15* 									 (C8->48 @ ????) -------@@@
	LD	BC, $07FF
	LD	(HL), 0
	LDIR			; clear middle 1/3 screen serial video so color attrs won't be visible

;	-------------------------- replacing color attr data with algorithm --------------------------------

;	LD	HL, L5900
;	LD	DE, $D900	; *16* 									 (D9->59 @ ????) -------@@@
;	LD	BC, $100
;	LDIR			; load the middle 1/3 screen color attrs for future place of anniv. logo
	LD	HL, $D900	; *16* 									 (D9->59 @ ????) -------@@@
	LD	DE, $D901	; *17* 									 (D9->59 @ ????) -------@@@
	LD	BC, $00FF
	LD	(HL),$00
	LDIR
	LD	A,$08
	LD	HL, $D904	; *18* 									 (D9->59 @ ????) -------@@@
	LD	DE, $D905	; *19* 									 (D9->59 @ ????) -------@@@
CLR1	LD	BC, $000A
	LD	(HL),$05
	LDIR
	LD	BC, $16
	ADD	HL,BC
	EX	DE,HL
	ADD	HL,BC
	EX	DE,HL
	DEC	A
	JR	NZ,CLR1

	LD	A,$05
	LD	HL, $D970	; *20* 									 (D9->59 @ ????) -------@@@
	LD	DE, $D971	; *21* 									 (D9->59 @ ????) -------@@@
CLR2	LD	BC, $000A
	LD	(HL),$03
	LDIR
	LD	BC, $16
	ADD	HL,BC
	EX	DE,HL
	ADD	HL,BC
	EX	DE,HL
	DEC	A
	JR	NZ,CLR2

;	-------------------------- replacing serial video data with algorithm --------------------------------

;	LD	HL, L4800	; start of serial video data of anniv. logo
;	LD	DE, $D000	; *17* start of last 1/3 serial video screen				 (D0->50 @ ????) -------@@@
;	LD	BC, $800		; size of 1/3 serial video screen
;	LDIR			; load the anniv logo in the bottom 1/3 screen
	LD	HL,$D000	; *22* start of last 1/3 serial video screen				 (D0->50 @ ????) -------@@@
	LD	DE,$D001	; *23* start of last 1/3 serial video screen				 (D0->50 @ ????) -------@@@
	LD	BC,$07FF
	LD	(HL),$00
	LDIR

	EX	AF,AF'
	LD	A,$08
	LD	HL,L5025
	LD	DE,$D025	; *24* start of last 1/3 serial video screen				 (D0->50 @ ????) -------@@@
SER2	EX	AF,AF'
	LD	A,$07
SER1	LD	BC,$0016
	LDIR
	LD	BC,$0A
	EX	DE,HL		; increase DE
	ADD	HL,BC		; by $EA
	EX	DE,HL		; so it can skip to the next line of $20 + offset 5
	DEC	A
	JR	NZ,SER1		; 7 cycles

	LD	BC,$20
	EX	DE,HL		; increase DE
	ADD	HL,BC		; by $20
	EX	DE,HL		; so it can start the next group of 8 lines (skipping line 1)
	EX	AF,AF'
	DEC	A
	JR	NZ,SER2		; 8 cycles
	EX	AF,AF'

	RET

PHBASE	DEFB	$23,$46
	DEFB	$24,$43
	DEFB	$25,$44
	DEFB	$26,$41		; character codes for the star phases
PHBAS1	DEFB	$25,$42		; alternating with color attrs for phases
	DEFB	$24,$46
	DEFB	$23,$42
	DEFB	$20,$00

;START	LD      BC,$3002
START	LD      B,$30
L0DEL	CALL	DELAY
	LD	A,$00
	IN      A, ($FE)
	AND	$3F
	CP	$3F
	RET	NZ	; Return to Boot Manager if any key pressed
	DJNZ    L0DEL
;	DEC     C
;	JR      NZ,L0DEL
	
	CALL	VSCR1	; move CoBra logo up
	CALL	ANNIV	; load anniversary graphics
	CALL	VSCR2	; scroll (reveal) anniversary graphics

	LD	HL,$1005
	LD	DE,M_20		; "ITC BRASOV - 1986-2016"
	CALL	MSG_PR
	LD	HL,$1101
	LD	DE,M_21		; "30 ANI DE LA PROIECTAREA COBRA"
	CALL	MSG_PR
	LD	HL,$1201
	LD	DE,M_31
	CALL	MSG_PR

	LD	HL,$1308
	LD	DE,M_22		; "GHEORGHE TOACSE"
	CALL	MSG_PR

;	we are displaying these by scrolling into view instead (see below)
;	LD	HL,$1401
;	LD	DE,M_23		; "VASILE PRODAN"
;	CALL	MSG_PR
;	LD	HL,$1501
;	LD	DE,M_24		; "WAGNER BERND"
;	CALL	MSG_PR
;	LD	HL,$1601
;	LD	DE,M_25		; "SORIN FINICHIU"
;	CALL	MSG_PR
;	LD	HL,$1701
;	LD	DE,M_26		; "MIRCEA UNGUR"
;	CALL	MSG_PR

;	LD	HL,$1411
;	LD	DE,M_27		; "MARCEL AREFTA"
;	CALL	MSG_PR
;	LD	HL,$1511
;	LD	DE,M_28		; "MIRCEA POP"
;	CALL	MSG_PR
;;	LD	HL,$1611
;	LD	DE,M_29		; "SORIN CISMAS"
;	CALL	MSG_PR
;	LD	HL,$1711
;	LD	DE,M_30		; "ALEXANDRU ANTAL"
;	CALL	MSG_PR

	CALL	DELAY

	LD	DE,$DA01	; *25* start of last 1/3 serial video screen				 (DA->5A @ ????) -------@@@
	LD	HL,$DA00	; *26* start of last 1/3 serial video screen				 (DA->5A @ ????) -------@@@
	LD	BC,$1F
	LD	(HL),$44
	LDIR			; set color attrs for "ITC BRASOV - 1986-2016"

	CALL	DELAY4

	LD	DE,$DA21	; *27* start of last 1/3 serial video screen				 (DA->5A @ ????) -------@@@
	LD	HL,$DA20	; *28* start of last 1/3 serial video screen				 (DA->5A @ ????) -------@@@
	LD	BC,$1F
	LD	(HL),$42
	LDIR			; set color attrs for "30 ANI DE LA PROIECTAREA COBRA"

	CALL	DELAY4

	LD	B,$10
FLASH2	PUSH	BC
	LD	B,$0C
	LD	IX,FLASH
FLASH1	PUSH	BC
	LD	A,(IX+0)
	LD	DE,$DA41	; *29* start of last 1/3 serial video screen				 (DA->5A @ ????) -------@@@
	LD	HL,$DA40	; *30* start of last 1/3 serial video screen				 (DA->5A @ ????) -------@@@
	LD	BC,$1F
	LD	(HL),A
	LDIR			; set color attrs for "DE CATRE O ECHIPA FORMATA DIN:"
	OUT	($FE),A
	CALL	DELAY5
	LD	A,$40
	OUT	($FE),A
	CALL	DELAY2
	INC	IX
	POP	BC
	DJNZ	FLASH1
	POP	BC
	DJNZ	FLASH2

;	LD	DE,$5A41
;	LD	HL,$5A40
;	LD	BC,$1F
;	LD	(HL),$41
;	LDIR			; set color attrs for "DE CATRE O ECHIPA FORMATA DIN:"

	CALL	DELAY4

	LD	DE,$DA61	; *31* start of last 1/3 serial video screen				 (DA->5A @ ????) -------@@@
	LD	HL,$DA60	; *32* start of last 1/3 serial video screen				 (DA->5A @ ????) -------@@@
	LD	BC,$1F
	LD	(HL),$44
	LDIR			; set color attrs for "GHEORGHE TOACSE"

	CALL	DELAY4

	LD	A,$04
	LD	DE,$DA81	; *33* start of last 1/3 serial video screen				 (DA->5A @ ????) -------@@@
	LD	HL,$DA80	; *34* start of last 1/3 serial video screen				 (DA->5A @ ????) -------@@@
TEAM	LD	BC,$0F
	LD	(HL),$05	; INK=cyan for left side of lower 1/3
	LDIR
	INC	DE
	INC	HL
	LD	BC,$0F
	LD	(HL),$03	; INK=magenta for right side of lower 1/3
	LDIR
	INC	DE
	INC	HL
	DEC	A
	JR	NZ,TEAM

	LD	A,$04		; char row to shift
	LD	IX,M_23		; "VASILE PRODAN"
	CALL	MSGPSHR
	LD	A,$05		; char row to shift
	LD	IX,M_24		; "WAGNER BERND"
	CALL	MSGPSHR
	LD	A,$06		; char row to shift
	LD	IX,M_25		; "SORIN FINICHIU"
	CALL	MSGPSHR
	LD	A,$07		; char row to shift
	LD	IX,M_26		; "MIRCEA UNGUR"
	CALL	MSGPSHR

	LD	A,$04		; char row to shift
	LD	IX,M_27		; "MARCEL AREFTA"
	CALL	MSGPSHL
	LD	A,$05		; char row to shift
	LD	IX,M_28		; "MIRCEA POP"
	CALL	MSGPSHL
	LD	A,$06		; char row to shift
	LD	IX,M_29		; "SORIN CISMAS"
	CALL	MSGPSHL
	LD	A,$07		; char row to shift
	LD	IX,M_30		; "ALEXANDRU ANTAL"
	CALL	MSGPSHL


	JP	L0110


			; ########## GENERATE STARS ###########
			; PARAMETERS: IX=start of stars, IY=start phase, A=nr of stars
;	LD	IX,SBASE	; start of stars to process
;	LD	IY,PHBASE
STARS	LD	D,A
	LD	BC,$0400	; B = number of cycles = number of star phases = 8
STARS1	PUSH	BC		; *** phase nr
	PUSH	IX		; *** start of stars to process
	LD	B,D		; B = number of stars to process in one phase
STARS2	PUSH	BC		; *** nr of stars (in B)
	LD	L,(IX+0)	; column of current star
	LD	H,(IX+1)	; row of current star
	LD	A,(IY+0)	; star phase to print for all stars in this cycle
	LD	C,A		; current star phase (char code to print)
	CALL	CHR_PR		; print star phase

	; computing this from row/column values instead of storing direct addresses (save space)
;	LD	L,(IX+2)	; video attr addr low byte
;	LD	H,(IX+3)	; HL = addr of video attr for crt star
	EXX
	LD	B,(IX+1)	; row of current star
	INC	B
	LD	DE,$0020
	LD	HL,$D7E0	; *35* start of last 1/3 serial video screen				 (D7->57 @ ????) -------@@@
ATTC	ADD	HL,DE
	DJNZ	ATTC
	LD	D,$00
	LD	E,(IX+0)	; column of current star
	ADD	HL,DE
	PUSH	HL
	EXX
	POP	HL

	LD	A,(IY+1)	; current ink for this cycle
	LD	(HL),A		; set it for the star just printed
	INC	IX
	INC	IX
;	INC	IX		; commented this out because we don't store attr addresses anymore to save 2 bytes per star
;	INC	IX
	POP	BC		; *** nr of stars (in B)
	DJNZ	STARS2
	CALL	DELAY2		; end of one cycle (phase)

	POP	IX		; reset start of stars

	INC	IY
	INC	IY		; point to next star phase to print
	POP	BC		; *** phase nr
	DJNZ	STARS1

	RET

L0110	LD	IX,P01
	LD	IY,PHBASE
	LD	A,$01
	CALL	STARS

	LD	IX,P02
	LD	IY,PHBASE
	LD	A,$03
	CALL	STARS

	LD	IX,P05
	LD	IY,PHBASE
	LD	A,$02
	CALL	STARS

	LD	IX,P01
	LD	IY,PHBAS1
	LD	A,$01
	CALL	STARS

	LD	IX,P07
	LD	IY,PHBASE
	LD	A,$03
	CALL	STARS

	LD	IX,P02
	LD	IY,PHBAS1
	LD	A,$03
	CALL	STARS

	LD	IX,P10
	LD	IY,PHBASE
	LD	A,$04
	CALL	STARS

	LD	IX,P05
	LD	IY,PHBAS1
	LD	A,$02
	CALL	STARS

	LD	IX,P13
	LD	IY,PHBASE
	LD	A,$04
	CALL	STARS

	LD	IX,P07
	LD	IY,PHBAS1
	LD	A,$03
	CALL	STARS

	LD	IX,P16
	LD	IY,PHBASE
	LD	A,$07
	CALL	STARS

	LD	IX,P10
	LD	IY,PHBAS1
	LD	A,$04
	CALL	STARS

	LD	IX,P22
	LD	IY,PHBASE
	LD	A,$09
	CALL	STARS

	LD	IX,P13
	LD	IY,PHBAS1
	LD	A,$04
	CALL	STARS

	LD	IX,P29
	LD	IY,PHBASE
	LD	A,$06
	CALL	STARS

	LD	IX,P16
	LD	IY,PHBAS1
	LD	A,$07
	CALL	STARS

	LD	IX,P35
	LD	IY,PHBASE
	LD	A,$04
	CALL	STARS

	LD	IX,P22
	LD	IY,PHBAS1
	LD	A,$09
	CALL	STARS

	LD	IX,P39
	LD	IY,PHBASE
	LD	A,$03
	CALL	STARS

	LD	IX,P29
	LD	IY,PHBAS1
	LD	A,$06
	CALL	STARS

	LD	IX,P42
	LD	IY,PHBASE
	LD	A,$04
	CALL	STARS

	LD	IX,P35
	LD	IY,PHBAS1
	LD	A,$04
	CALL	STARS

	LD	IX,P47
	LD	IY,PHBASE
	LD	A,$05
	CALL	STARS

	LD	IX,P39
	LD	IY,PHBAS1
	LD	A,$03
	CALL	STARS

	LD	IX,P52
	LD	IY,PHBASE
	LD	A,$06
	CALL	STARS

	LD	IX,P42
	LD	IY,PHBAS1
	LD	A,$04
	CALL	STARS

	LD	IX,P58
	LD	IY,PHBASE
	LD	A,$06
	CALL	STARS

	LD	IX,P47
	LD	IY,PHBAS1
	LD	A,$05
	CALL	STARS

	LD	IX,P64
	LD	IY,PHBASE
	LD	A,$06
	CALL	STARS

	LD	IX,P52
	LD	IY,PHBAS1
	LD	A,$06
	CALL	STARS

	LD	IX,P70
	LD	IY,PHBASE
	LD	A,$05
	CALL	STARS

	LD	IX,P58
	LD	IY,PHBAS1
	LD	A,$06
	CALL	STARS

	LD	IX,P75
	LD	IY,PHBASE
	LD	A,$05
	CALL	STARS

	LD	IX,P64
	LD	IY,PHBAS1
	LD	A,$06
	CALL	STARS

	LD	IX,P80
	LD	IY,PHBASE
	LD	A,$05
	CALL	STARS

	LD	IX,P70
	LD	IY,PHBAS1
	LD	A,$05
	CALL	STARS

	LD	IX,P85
	LD	IY,PHBASE
	LD	A,$04
	CALL	STARS

	LD	IX,P75
	LD	IY,PHBAS1
	LD	A,$05
	CALL	STARS

	LD	IX,P89
	LD	IY,PHBASE
	LD	A,$04
	CALL	STARS

	LD	IX,P80
	LD	IY,PHBAS1
	LD	A,$05
	CALL	STARS

	LD	IX,P93
	LD	IY,PHBASE
	LD	A,$04
	CALL	STARS

	LD	IX,P85
	LD	IY,PHBAS1
	LD	A,$04
	CALL	STARS

	LD	IX,P97
	LD	IY,PHBASE
	LD	A,$03
	CALL	STARS

	LD	IX,P89
	LD	IY,PHBAS1
	LD	A,$04
	CALL	STARS

	LD	IX,P100
	LD	IY,PHBASE
	LD	A,$01
	CALL	STARS

	LD	IX,P93
	LD	IY,PHBAS1
	LD	A,$04
	CALL	STARS

	LD	IX,P97
	LD	IY,PHBAS1
	LD	A,$03
	CALL	STARS

	LD	IX,P100
	LD	IY,PHBAS1
	LD	A,$01
	CALL	STARS

	LD      D, $07	; ######### BEGINNING OF ONE SCREEN CYCLE (KBD READ + SCROLL LEFT) #########
	LD      BC,$0000
L0115	LD      A, $00	; keyboard test, all rows (all keys)
	IN      A, ($FE)
	AND	$3F
	CP	$3F
	RET	NZ	; Return to Boot Manager if any key pressed
	DJNZ    L0115	; cycle the above 256 times
	DEC     C
	JR      NZ,L0115	; cycle the above 256 times (65536 times total)
	DEC     D
	JR      NZ,L0115	; cycle the above 7 times (458752 times total)
	LD      B, $20
L0138	PUSH    BC	; BC=2000
	CALL    L0159	; call SERIAL VIDEO GRAPHIC SCROLL LEFT 4 PIXELS
	LD      HL,$D901	; *36* video attr start addr for 2nd third of video RAM in startup hw cfg (D9->59 @ ????) -------@@@
	LD      B, $08	; 	  ######## 00D5-00E7 mid screen attribute scroll left 1 char ########
L0141	PUSH    BC	; BC=0800 (B=08 used as row counter)    <--- <--- <--- <--- <---|
	LD      BC,$001F ; screen width in chars minus 1				|
	LD      D,H	;								|
	LD      E,L	; DE=D901							|
	DEC     E	; DE=D900 (start of row 1 (of 8) of attr's for middle third of screen)
	LD      A, (DE)	; copy the first attr byte on the row				|
	LDIR		; shift 31 attribute bytes left, first byte overwritten		|
	LD      (DE),A	; save the former first byte into the last on the row		|
	INC     L	; HL now points to first char on next row			|
	INC     E	; DE now points to last char on row				|
	POP     BC	; POP back the row counter					|
	DJNZ    L0141	; ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ---> ->|    ########
	CALL    L0159	; call SERIAL VIDEO GRAPHIC SCROLL LEFT 4 PIXELS
	POP     BC
	DJNZ    L0138
	JP      L0110	; ###### END COBRA GRAPHIC LOGO ROUTINE #########

L0159	LD      B, $04	; ######## SERIAL VIDEO GRAPHIC SCROLL LEFT 4 PIXELS ########
L015B	PUSH    BC	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <-|
	LD      HL,$CFFF	; *37* address within video memory (end of middle third serial video)	 (CF->4F @ ????) -------@@@
	LD      B, $08	; char row counter in a third of screen									|
L0161	PUSH    BC	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <---|	|
	LD      B, $08	; pixel row counter in a char row								|	|
L0164	PUSH    BC	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <-----|	|	|
	LD      D,H	; \ backup the address for the end of							|	|	|
	LD      E,L	; / current pixel row of serial video in DE						|	|	|
	LD      B, $20	; width of screen in characters								|	|	|
	SCF		; start shift with 1 ink bit inserted at right edge of screen-----------+		|	|	|
L016A	RL      (HL)	; shift left (through CY) the 8 consecutive pixels at (HL)		|		|	|	|
	DEC     HL	; move to next char to the left on the same pixel row			|		|	|	|
	DJNZ    L016A	; keep doing it until the left side of screen reached			|		|	|	|
	JR      C,L0174	; if ink bit reaches left side of screen it already was copied to right(|)-->|		|	|	|
	LD      A,(DE)	;  if no ink bit carried from left screen edge				     |		|	|	|
	DEC     A	;  then delete the 1 ink bit already inserted 6 lines above		     |		|	|	|
	LD      (DE),A	;									     |		|	|	|
L0174	POP     BC	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <----|		|	|	|
	OR      A	; reset CY flag										|	|	|
	LD      DE,$00E0 ; addr shift to next pixel row up							|	|	|
	SBC     HL, DE	; HL = HL - DE (HL now points to right end of next pixel row up)			|	|	|
	DJNZ    L0164	; restart left shift for the next pixel row up in current char row ---> ---> ---> ----->|	|	|
	LD      BC,$07E0 ; addr shift to next char row down								|	|
	ADD     HL, BC	; HL = HL + BC (HL now points to right end of next char row down)				|	|
	POP     BC	; retrieve the char row counter for the screen middle						|	|
	DJNZ    L0161	; restart left shift for the next char row down in screen middle ---> ---> ---> ---> ---> ----->|	|
	POP     BC	; 1 pixel shift completed for entire logo, retrieve pixel shift counter					|
	DJNZ    L015B	; if 4 pix shifts not completed, restart shift for entire logo -----> ---> ---> ---> ---> ---> ---> --->|
	RET		; ######## SERIAL VIDEO GRAPHIC SCROLL LEFT 4 PIXELS END #############


			; ######## SERIAL VIDEO GRAPHIC SCROLL LEFT 128 PIXELS ########
			; circular scroll left on the right half of a character line in the bottom 1/3 of screen
			; A=char row (0-7)
;LOOPSHF	LD      HL,$D71F ; *38* address within video memory (end of middle third serial video)		 (D7->57 @ ????) -------@@@
;	LD	BC,$0020
;L1SHF5	OR	A
;	JR	Z,L1SHF6
;	ADD	HL,BC
;	DEC	A
;	JR	NZ,L1SHF5

;L1SHF6	LD      B, $80	; nr of pixels to scroll left
;L1SHF1	PUSH	HL
;	PUSH    BC	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <---|

;	LD      B, $08	; pixel row counter in a char row								|
;L1SHF2	PUSH    BC	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <-----|	|
;	LD      D,H	; \ backup the address for the end of							|	|
;	LD      E,L	; / current pixel row of serial video in DE						|	|
;	LD      B, $10	; width of screen in characters								|	|
;	SCF		; start shift with 1 ink bit inserted at right edge of screen-----------+		|	|
;L1SHF3	RL      (HL)	; shift left (through CY) the 8 consecutive pixels at (HL)		|		|	|
;	DEC     HL	; move to next char to the left on the same pixel row			|		|	|
;	DJNZ    L1SHF3	; keep doing it until the left side of screen reached			|		|	|
;	JR      C,L1SHF4 ;if ink bit reaches left side of screen it already was copied to right(|)-->|		|	|
;	LD      A,(DE)	;  if no ink bit carried from left screen edge				     |		|	|
;	DEC     A	;  then delete the 1 ink bit already inserted 6 lines above		     |		|	|
;	LD      (DE),A	;									     |		|	|
;L1SHF4	POP     BC	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <----|		|	|
;	OR      A	; reset CY flag										|	|
;	LD      DE,$00F0 ; addr shift to next pixel row up							|	|
;	SBC     HL, DE	; HL = HL - DE (HL now points to right end of next pixel row up)			|	|
;	DJNZ    L1SHF2	; restart left shift for the next pixel row up in current char row ---> ---> ---> ----->|	|

;	POP     BC	; 1 pixel shift completed for entire logo, retrieve pixel shift counter				|
;	POP	HL
;	CALL	DELAY
;	DJNZ    L1SHF1	; if nr of pixels to scroll not completed, restart shift for entire logo -----> ---> ---> ----->|
;	RET		; ######## SERIAL VIDEO GRAPHIC SCROLL LEFT 128 PIXELS END #############


MSGCOP	LD	IY,$8050	; start of buffer zone

	LD	B,$10		; message length
MSGC	PUSH	BC	; ****
	LD	C,(IX+0)	; message character
	LD	HL,CBASE ; character definitions base addr
	LD	B,0	; BC = character to print on 16 bit
	RL	B	; reset CY
	RL	C	; ] multiply
	RL	B	; ] contents of BC
	RL	C	;
	RL	B	;
	RL	C	;
	RL	B	; ] by 8
	ADD	HL,BC	; HL = char addr in char table
	PUSH	IY
	POP	DE
	LD	BC,$0008
	LDIR
	PUSH	DE
	POP	IY
	INC	IX	; go to next char in message
	POP	BC	; ****
	DJNZ	MSGC	; copy all chars in the message to $8050 - 80CF

	RET

			; ######## SERIAL VIDEO PRINT SCROLL LEFT 128 PIXELS ########
			; scroll message left into the right half of a character row in the bottom 1/3 of screen
			; A=char row (0-7), IX=start of message string
			; show a 16-char message by scrolling it from right into screen
MSGPSHL	CALL	MSGCOP	; ---------------- message copied in buffer zone ---------------------
		
	LD	IY,$8057 ; bottom line of first char in buffer zone

	LD      HL,$D71F ; *38* address within video memory						 (D7->57 @ ????) -------@@@
	LD	BC,$0020
L2SHF5	OR	A
	JR	Z,L2SHF6
	ADD	HL,BC
	DEC	A
	JR	NZ,L2SHF5

L2SHF6	LD	B,$10	; shift distance in characters
L2SHF7	PUSH	BC	; **##**

	LD      B, $08	; nr of pixels to scroll left
L2SHF1	PUSH	IY	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <---|
	PUSH	HL
	PUSH    BC

	LD      B, $08	; pixel row counter in a char row								|
L2SHF2	PUSH    BC	; **** <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <-----|	|
	LD      D,H	; \ backup the address for the end of							|	|
	LD      E,L	; / current pixel row of serial video in DE						|	|
	LD      B, $10	; width of shift area in characters							|	|
	RLC	(IY+0)	; get first bit of invisible message
L2SHF3	RL      (HL)	; shift left (through CY) the 8 consecutive pixels at (HL)				|	|
	DEC     HL	; move to next char to the left on the same pixel row					|	|
	DJNZ    L2SHF3	; keep doing it until the left side of shift zone reached				|	|
L2SHF4	POP     BC	; **** pixel row counter in a char row							|	|
	LD      DE,$00F0 ; addr shift to next pixel row up							|	|
	SBC     HL, DE	; HL = HL - DE (HL now points to right end of next pixel row up)			|	|
	DEC	IY
	DJNZ    L2SHF2	; restart left shift for the next pixel row up in current char row ---> ---> ---> ----->|	|

	POP     BC	; 1 pixel shift completed for entire logo, retrieve pixel shift counter				|
	POP	HL
	POP	IY	; reload addr of bottom line of current char
	CALL	DELAY1
	DJNZ    L2SHF1	; if nr of pixels to scroll not completed, restart shift for entire logo -----> ---> ---> ----->|

	LD	BC,$08
	ADD	IY,BC
	POP	BC	; **##**
	DJNZ	L2SHF7

	RET		; ######## SERIAL VIDEO GRAPHIC SCROLL LEFT 128 PIXELS END #############


			; ######## SERIAL VIDEO PRINT SCROLL RIGHT 128 PIXELS ########
			; scroll message right into the left half of a character row in the bottom 1/3 of screen
			; A=char row (0-7), IX=start of message string
			; show a 16-char message by scrolling it from right into screen
MSGPSHR	CALL	MSGCOP	; ---------------- message copied in buffer zone ---------------------

	LD	IY,$80CF ; bottom line of last char in buffer zone

	LD      HL,$D700 ; *39* address within video memory						 (D7->57 @ ????) -------@@@
	LD	BC,$0020
L3SHF5	OR	A
	JR	Z,L3SHF6
	ADD	HL,BC
	DEC	A
	JR	NZ,L3SHF5

L3SHF6	LD	B,$10	; shift distance in characters
L3SHF7	PUSH	BC	; **##**

	LD      B, $08	; nr of pixels to scroll right
L3SHF1	PUSH	IY	; <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <---|
	PUSH	HL
	PUSH    BC

	LD      B, $08	; pixel row counter in a char row								|
L3SHF2	PUSH    BC	; **** <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <--- <-----|	|
	LD      D,H	; \ backup the address for the end of							|	|
	LD      E,L	; / current pixel row of serial video in DE						|	|
	LD      B, $10	; width of shift area in characters							|	|
	RRC	(IY+0)	; get first bit of invisible message
L3SHF3	RR      (HL)	; shift right (through CY) the 8 consecutive pixels at (HL)				|	|
	INC     HL	; move to next char to the right on the same pixel row					|	|
	DJNZ    L3SHF3	; keep doing it until the right side of shift zone reached				|	|
L3SHF4	POP     BC	; **** pixel row counter in a char row							|	|
	LD      DE,$0110 ; addr shift to next pixel row up							|	|
	SBC     HL, DE	; HL = HL - DE (HL now points to left end of next pixel row up)			|	|
	DEC	IY
	DJNZ    L3SHF2	; restart left shift for the next pixel row up in current char row ---> ---> ---> ----->|	|

	POP     BC	; 1 pixel shift completed for entire logo, retrieve pixel shift counter				|
	POP	HL
	POP	IY	; reload addr of bottom line of current char
	CALL	DELAY1
	DJNZ    L3SHF1	; if nr of pixels to scroll not completed, restart shift for entire logo -----> ---> ---> ----->|

	LD	B,$08
;	ADD	IY,BC
L3SHF8	DEC	IY
	DJNZ	L3SHF8
	POP	BC	; **##**
	DJNZ	L3SHF7

	RET		; ######## SERIAL VIDEO GRAPHIC SCROLL LEFT 128 PIXELS END #############

DELAY4	LD	B,$18
DELAY41	CALL	DELAY
	DJNZ	DELAY41
	RET

DELAY5	EXX
	LD	BC,$0060
	LD	DE,$9001
	LD	HL,$9000
	LD	(HL),0
	LDIR
	EXX
	RET

L0188	DEFB      $FF	; ############## GRAPHIC DATA BLOCK ################
	DEFB      $E0
	DEFB      $FF
	DEFB      $1F
	DEFB      $B1
	DEFB      $C8	; *40*	(C8->48)			 -------@@@
	DEFB      $45
	DEFB      $B9
	DEFB      $22
	DEFB      $02
	DEFB      $1F
	DEFB      $A2
	DEFB      $16
	DEFB      $22
	DEFB      $02
	DEFB      $1F
	DEFB      $A2
	DEFB      $16
	DEFB      $25
	DEFB      $15
	DEFB      $09
	DEFB      $75
	DEFB      $43
	DEFB      $25
	DEFB      $BC
	DEFB      $02
	DEFB      $19
	DEFB      $25
	DEFB      $BC
	DEFB      $02
	DEFB      $19
	DEFB      $07
	DEFB      $1D
	DEFB      $D9
	DEFB      $07
	DEFB      $1D
	DEFB      $0C
	DEFB      $9A
	DEFB      $C8	; *41*	(C8->48)			 -------@@@
	DEFB      $07
	DEFB      $A5
	DEFB      $90
	DEFB      $FF
	DEFB      $88
	DEFB      $FF
	DEFB      $E5
	DEFB      $FF
	DEFB      $FF
	DEFB      $31
	DEFB      $07
	DEFB      $0C
	DEFB      $82
	DEFB      $C8	; *42*	(C8->48)			 -------@@@
	DEFB      $FF
	DEFB      $FF
	DEFB      $FF
	DEFB      $6D
	DEFB      $7F
	DEFB      $09
	DEFB      $07
	DEFB      $F7
	DEFB      $07
	DEFB      $DF
	DEFB      $FF
	DEFB      $09
	DEFB      $CC
	DEFB      $C8	; *43*	(C8->48)			 -------@@@
	DEFB      $7B
	DEFB      $92
	DEFB      $FF
	DEFB      $FF
	DEFB      $EB
	DEFB      $FF
	DEFB      $FF
	DEFB      $C4
	DEFB      $10
	DEFB      $AF
	DEFB      $C8	; *44*	(C8->48)			 -------@@@
	DEFB      $FC
	DEFB      $02
	DEFB      $FC
	DEFB      $02
	DEFB      $FC
	DEFB      $02
	DEFB      $FC
	DEFB      $02
	DEFB      $FC
	DEFB      $02
	DEFB      $FC
	DEFB      $02
	DEFB      $0B
	DEFB      $F3
	DEFB      $0B
	DEFB      $06
	DEFB      $87
	DEFB      $C8	; *45*	(C8->48)			 -------@@@
	DEFB      $C0
	DEFB      $FF
	DEFB      $FF
	DEFB      $72
	DEFB      $FF
	DEFB      $0B
	DEFB      $46
	DEFB      $C8	; *46*	(C8->48)			 -------@@@
	DEFB      $74
	DEFB      $6E
	DEFB      $3D
	DEFB      $52
	DEFB      $8E
	DEFB      $9F
	DEFB      $FE
	DEFB      $DD
	DEFB      $FF
	DEFB      $82
	DEFB      $11
	DEFB      $8C
	DEFB      $C8	; *47*	(C8->48)			 -------@@@
	DEFB      $62
	DEFB      $55
	DEFB      $20
	DEFB      $E1
	DEFB      $70
	DEFB      $8E
	DEFB      $DA
	DEFB      $A3
	DEFB      $7A
	DEFB      $5F
	DEFB      $9F
	DEFB      $5F
	DEFB      $CC
	DEFB      $2A
	DEFB      $28
	DEFB      $08
	DEFB      $0B
	DEFB      $62
	DEFB      $C8	; *48*	(C8->48)			 -------@@@
	DEFB      $E5
	DEFB      $FF
	DEFB      $FF
	DEFB      $59
	DEFB      $F7
	DEFB      $07
	DEFB      $A5
	DEFB      $70
	DEFB      $B6
	DEFB      $D1
	DEFB      $13
	DEFB      $D1
	DEFB      $C8	; *49*	(C8->48)			 -------@@@
	DEFB      $02
	DEFB      $02
	DEFB      $01
	DEFB      $88
	DEFB      $37
	DEFB      $07
	DEFB      $2E
	DEFB      $90
	DEFB      $3F
	DEFB      $A5
	DEFB      $8B
	DEFB      $BF
	DEFB      $02
	DEFB      $F9
	DEFB      $FF
	DEFB      $FF
	DEFB      $02
	DEFB      $02
	DEFB      $08
	DEFB      $D1
	DEFB      $CA	; *50*	(CA->4A)			 -------@@@
	DEFB      $76
	DEFB      $90
	DEFB      $ED
	DEFB      $9A
	DEFB      $2E
	DEFB      $E8
	DEFB      $07
	DEFB      $09
	DEFB      $CC
	DEFB      $C9	; *51*	(C9->49)			 -------@@@
	DEFB      $7B
	DEFB      $86
	DEFB      $78
	DEFB      $92
	DEFB      $EB
	DEFB      $9F
	DEFB      $27
	DEFB      $FC
	DEFB      $0B
	DEFB      $AC
	DEFB      $C8	; *52*	(C8->48)			 -------@@@
	DEFB      $22
	DEFB      $0B
	DEFB      $F3
	DEFB      $FC
	DEFB      $FF
	DEFB      $FA
	DEFB      $FF
	DEFB      $C7
	DEFB      $FF
	DEFB      $1C
	DEFB      $03
	DEFB      $BB
	DEFB      $CD	; *53*	(CD->4D)			 -------@@@
	DEFB      $B4
	DEFB      $F6
	DEFB      $10
	DEFB      $2A
	DEFB      $C8	; *54*	(C8->48)			 -------@@@
	DEFB      $C6
	DEFB      $54
	DEFB      $03
	DEFB      $FD
	DEFB      $72
	DEFB      $38
	DEFB      $F5
	DEFB      $DC
	DEFB      $7B
	DEFB      $30
	DEFB      $02
	DEFB      $F8
	DEFB      $32
	DEFB      $A6
	DEFB      $26
	DEFB      $0C
	DEFB      $66
	DEFB      $C8	; *55*	(C8->48)			 -------@@@
	DEFB      $28
	DEFB      $FC
	DEFB      $BB
	DEFB      $FF
	DEFB      $DE
	DEFB      $FB
	DEFB      $E4
	DEFB      $BA
	DEFB      $08
	DEFB      $FA
	DEFB      $07
	DEFB      $01
	DEFB      $46
	DEFB      $CF	; *56*	(CF->4F)			 -------@@@
	DEFB      $01
	DEFB      $46
	DEFB      $CE	; *57*	(CE->4E)			 -------@@@
	DEFB      $05
	DEFB      $CC
	DEFB      $CA	; *58*	(CA->4A)			 -------@@@
	DEFB      $FF
	DEFB      $FA
	DEFB      $7E
	DEFB      $45
	DEFB      $01
	DEFB      $46
	DEFB      $CC	; *59*	(CC->4C)			 -------@@@
	DEFB      $01
	DEFB      $46
	DEFB      $CB	; *60*	(CB->4B)			 -------@@@
	DEFB      $0C
	DEFB      $91
	DEFB      $C8	; *61*	(C8->48)			 -------@@@
	DEFB      $B6
	DEFB      $FD
	DEFB      $E1
	DEFB      $9B
	DEFB      $7E
	DEFB      $85
	DEFB      $FD
	DEFB      $FF
	DEFB      $61
	DEFB      $79
	DEFB      $2D
	DEFB      $0A
	DEFB      $24
	DEFB      $C9	; *62*	(C9->49)			 -------@@@
	DEFB      $6A
	DEFB      $FC
	DEFB      $57
	DEFB      $EC
	DEFB      $F5
	DEFB      $FB
	DEFB      $08
	DEFB      $56
	DEFB      $AB
	DEFB      $02
	DEFB      $CC
	DEFB      $CB	; *63*	(CB->4B)			 -------@@@
	DEFB      $BF
	DEFB      $04
	DEFB      $ED
	DEFB      $CA	; *64*	(CA->4A)			 -------@@@
	DEFB      $E1
	DEFB      $BF
	DEFB      $DD
	DEFB      $03
	DEFB      $D1
	DEFB      $CB	; *65*	(CB->4B)			 -------@@@
	DEFB      $95
	DEFB      $29
	DEFB      $01
	DEFB      $E6
	DEFB      $C8
	DEFB      $0D
	DEFB      $C3
	DEFB      $C8	; *66*	(C8->48)			 -------@@@
	DEFB      $CD
	DEFB      $62
	DEFB      $F3
	DEFB      $5A
	DEFB      $E3
	DEFB      $FF
	DEFB      $A1
	DEFB      $40
	DEFB      $1E
	DEFB      $4A
	DEFB      $02
	DEFB      $59
	DEFB      $0D
	DEFB      $8F
	DEFB      $CA	; *67*	(CA->4A)			 -------@@@
	DEFB      $FC
	DEFB      $02
	DEFB      $97
	DEFB      $9B
	DEFB      $08
	DEFB      $02
	DEFB      $09
	DEFB      $F5
	DEFB      $09
	DEFB      $2A
	DEFB      $62
	DEFB      $BB
	DEFB      $01
	DEFB      $E6
	DEFB      $C8
	DEFB      $04
	DEFB      $F0
	DEFB      $CA	; *68*	(CA->4A)			 -------@@@
	DEFB      $F8
	DEFB      $DD
	DEFB      $A8
	DEFB      $02
	DEFB      $C3
	DEFB      $C9	; *69*	(C9->49)			 -------@@@
	DEFB      $7F
	DEFB      $14
	DEFB      $94
	DEFB      $C8	; *70*	(C8->48) !!			 -------@@@
	DEFB      $02
	DEFB      $5C
	DEFB      $FB
	DEFB      $A0
	DEFB      $FF
	DEFB      $22
	DEFB      $02
	DEFB      $52
	DEFB      $A9
	DEFB      $02
	DEFB      $19
	DEFB      $09
	DEFB      $4D
	DEFB      $A7
	DEFB      $09
	DEFB      $ED
	DEFB      $AA
	DEFB      $02
	DEFB      $5C
	DEFB      $0C
	DEFB      $43
	DEFB      $C8	; *71*	(C8->48)			 -------@@@
	DEFB      $B5
	DEFB      $EA
	DEFB      $3F
	DEFB      $E3
	DEFB      $BA
	DEFB      $40
	DEFB      $C2
	DEFB      $FF
	DEFB      $FF
	DEFB      $11
	DEFB      $FF
	DEFB      $07
	DEFB      $43
	DEFB      $C9	; *72*	(C9->49)			 -------@@@
	DEFB      $E4
	DEFB      $9A
	DEFB      $84
	DEFB      $AA
	DEFB      $7F
	DEFB      $02
	DEFB      $07
	DEFB      $ED
	DEFB      $C9	; *73*	(C9->49)			 -------@@@
	DEFB      $FA
	DEFB      $7E
	DEFB      $BF
	DEFB      $FF
	DEFB      $FF
	DEFB      $45
	DEFB      $17
	DEFB      $26
	DEFB      $C8	; *74*	(C8->48) !!			 -------@@@
	DEFB      $D4
	DEFB      $98
	DEFB      $02
	DEFB      $1C
	DEFB      $02
	DEFB      $DC
	DEFB      $02
	DEFB      $1C
	DEFB      $02
	DEFB      $52
	DEFB      $FD
	DEFB      $20
	DEFB      $FD
	DEFB      $8C
	DEFB      $02
	DEFB      $1C
	DEFB      $DF
	DEFB      $02
	DEFB      $1C
	DEFB      $06
	DEFB      $ED
	DEFB      $11
	DEFB      $2A
	DEFB      $28
	DEFB      $C8	; *75*	(C8->48) !!			 -------@@@
	DEFB      $6A
	DEFB      $02
	DEFB      $1C
	DEFB      $02
	DEFB      $3C
	DEFB      $9F
	DEFB      $02
	DEFB      $1C
	DEFB      $02
	DEFB      $3C
	DEFB      $05
	DEFB      $99
	DEFB      $02
	DEFB      $1C
	DEFB      $02
	DEFB      $3C
	DEFB      $05
	DEFB      $0A
	DEFB      $8E
	DEFB      $02
	DEFB      $1C
	DEFB      $02
	DEFB      $42
	DEFB      $B9
	DEFB      $02
	DEFB      $1C
	DEFB      $9F
	DEFB      $02
	DEFB      $3C
	DEFB      $02
	DEFB      $1C
	DEFB      $9F
	DEFB      $02
	DEFB      $3C
	DEFB      $02
	DEFB      $1C
	DEFB      $9F
	DEFB      $02
	DEFB      $3C
	DEFB      $02
	DEFB      $1C
	DEFB      $01
	DEFB      $E6
	DEFB      $C8
	DEFB      $17
	DEFB      $8D
	DEFB      $C8	; *76*	(C8->48) !!			 -------@@@
	DEFB      $26
	DEFB      $02
	DEFB      $31
	DEFB      $03
	DEFB      $38
	DEFB      $66
	DEFB      $6D
	DEFB      $91
	DEFB      $6D
	DEFB      $2D
	DEFB      $63
	DEFB      $06
	DEFB      $02
	DEFB      $63
	DEFB      $D1
	DEFB      $06
	DEFB      $F8
	DEFB      $FF
	DEFB      $9F
	DEFB      $46
	DEFB      $02
	DEFB      $15
	DEFB      $06
	DEFB      $25
	DEFB      $C8	; *77*	(C8->48)			 -------@@@
	DEFB      $BE
	DEFB      $43
	DEFB      $FF
	DEFB      $FB
	DEFB      $C0
	DEFB      $08
	DEFB      $E9
	DEFB      $C9	; *78*	(C9->49)			 -------@@@
	DEFB      $3C
	DEFB      $02
	DEFB      $3D
	DEFB      $E1
	DEFB      $DD
	DEFB      $9D
	DEFB      $83
	DEFB      $29
	DEFB      $E6
	DEFB      $C8	; *79*	(C8->48) !!			 -------@@@
	DEFB      $01
	DEFB      $5F
	DEFB      $9D
	DEFB      $01
	DEFB      $07
	DEFB      $37
	DEFB      $1F
	DEFB      $9D
	DEFB      $01
	DEFB      $1D
	DEFB      $01
	DEFB      $1D
	DEFB      $01
	DEFB      $1F
	DEFB      $9E
	DEFB      $01
	DEFB      $1C
	DEFB      $01
	DEFB      $1C
	DEFB      $01
	DEFB      $9D
	DEFB      $01
	DEFB      $5D
	DEFB      $01
	DEFB      $20
	DEFB      $7C
	DEFB      $01
	DEFB      $3E
	DEFB      $01
	DEFB      $1C
	DEFB      $01
	DEFB      $20
	DEFB      $27
	DEFB      $54
	DEFB      $01
	DEFB      $5D
	DEFB      $01
	DEFB      $20
	DEFB      $7C
	DEFB      $01
	DEFB      $01
	DEFB      $45
	DEFB      $C8	; *80*	(C8->48)			 -------@@@
	DEFB      $C3
	DEFB      $01
	DEFB      $87
	DEFB      $C8	; *81*	(C8->48)			 -------@@@
	DEFB      $03
	DEFB      $01
	DEFB      $87
	DEFB      $C9	; *82*	(C9->49)			 -------@@@
	DEFB      $01
	DEFB      $01
	DEFB      $68
	DEFB      $CE	; *83*	(CE->4E)			 -------@@@
	DEFB      $E0
	DEFB      $01
	DEFB      $67
	DEFB      $CF	; *84*	(CF->4F)			 -------@@@
	DEFB      $07
	DEFB      $0A
	DEFB      $03
	DEFB      $D9	; *85*	(D9->59)	BLUE CROWN	 -------@@@
	DEFB      $01
	DEFB      $02
	DEFB      $27
	DEFB      $D9	; *86*	(D9->59)	YELLOW EYE	 -------@@@
	DEFB      $35
	DEFB      $01
	DEFB      $47
	DEFB      $D9	; *87*	(D9->59)	RED MOUTH	 -------@@@
	DEFB      $15
	DEFB      $04
	DEFB      $48
	DEFB      $D9	; *88*	(D9->59)	RED TONGUE	 -------@@@
	DEFB      $02
	DEFB      $01
	DEFB      $8B
	DEFB      $D9	; *89*	(D9->59)			 -------@@@
	DEFB      $03
	DEFB      $01
	DEFB      $AB
	DEFB      $D9	; *90*	(D9->59)			 -------@@@
	DEFB      $03
L03E0	DEFB      $07
	DEFB      $0E
	DEFB      $15
	DEFB      $1C
	DEFB      $23
	DEFB      $2A
	DEFB      $31
	DEFB      $38	; ################ END OF GRAPHIC BLOCK ################

			; ################ ANNIVERSARY GRAPHIC BLOCK - generated with SPECTRA Image Converter.exe from PNG drawn manually - logo in middle 1/3 ################

;	===========================================================================  2/3  =================================================================================
;	--------------------------------------------------- compress data by replacing part of it with algorithm ----------------------------------------------------------
;L4800	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4820	DEFB $00, $00, $00, $00, $00, $0F, $FF, $80, $00, $00, $00, $07, $FC, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4840	DEFB $00, $00, $00, $00, $00, $00, $01, $FF, $F8, $00, $1F, $FC, $07, $FF, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4860	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4880	DEFB $00, $00, $00, $00, $00, $00, $7F, $FF, $F8, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $1F, $E0, $00, $0F, $FF, $FF, $00, $0F, $F0, $00, $00, $00, $00, $00
;L48A0	DEFB $00, $00, $00, $00, $00, $00, $00, $01, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $03, $FC, $00, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L48C0	DEFB $00, $00, $00, $00, $00, $00, $00, $03, $FE, $00, $7F, $C0, $00, $7F, $C0, $00, $00, $1F, $F0, $FF, $80, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L48E0	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FF, $80, $00, $01, $FF, $FF, $F0, $00, $00, $00, $7F, $FF, $FF, $E0, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00

;L4900	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4920	DEFB $00, $00, $00, $00, $00, $0F, $FF, $F8, $00, $00, $00, $1F, $FF, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4940	DEFB $00, $00, $00, $00, $00, $00, $00, $1F, $FC, $00, $3F, $F0, $01, $FF, $80, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4960	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4980	DEFB $00, $00, $00, $00, $00, $00, $7F, $FF, $F0, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $1F, $F0, $00, $0F, $FF, $FF, $80, $0F, $F0, $00, $00, $00, $00, $00
;L49A0	DEFB $00, $00, $00, $00, $00, $00, $00, $01, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $03, $FC, $00, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L49C0	DEFB $00, $00, $00, $00, $00, $00, $00, $07, $FC, $00, $3F, $E0, $00, $FF, $80, $00, $00, $1F, $E0, $7F, $80, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L49E0	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FE, $00, $00, $00, $7F, $FF, $C0, $00, $00, $00, $FF, $FF, $FF, $F0, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00

;L4A00	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4A20	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FE, $00, $00, $00, $7F, $FF, $C0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4A40	DEFB $00, $00, $00, $00, $00, $00, $00, $07, $FC, $00, $3F, $E0, $00, $FF, $80, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4A60	DEFB $00, $00, $00, $00, $00, $00, $00, $01, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4A80	DEFB $00, $00, $00, $00, $00, $00, $7F, $FF, $F0, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $0F, $F0, $00, $0F, $FF, $FF, $C0, $0F, $F0, $00, $00, $00, $00, $00
;L4AA0	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $07, $FF, $FE, $00, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4AC0	DEFB $00, $00, $00, $00, $00, $00, $00, $1F, $FC, $00, $3F, $F0, $01, $FF, $80, $00, $00, $1F, $E0, $7F, $80, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4AE0	DEFB $00, $00, $00, $00, $00, $0F, $FF, $F8, $00, $00, $00, $1F, $FF, $00, $00, $00, $00, $FF, $FF, $FF, $F0, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00

;L4B00	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4B20	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FF, $80, $00, $01, $FF, $FF, $F0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4B40	DEFB $00, $00, $00, $00, $00, $00, $00, $03, $FE, $00, $7F, $C0, $00, $7F, $C0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4B60	DEFB $00, $00, $00, $00, $00, $00, $00, $01, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4B80	DEFB $00, $00, $00, $00, $00, $00, $7F, $FF, $F8, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $0F, $F0, $00, $0F, $FF, $FF, $C0, $0F, $F0, $00, $00, $00, $00, $00
;L4BA0	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $07, $F9, $FE, $00, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4BC0	DEFB $00, $00, $00, $00, $00, $00, $01, $FF, $F8, $00, $1F, $FC, $07, $FF, $00, $00, $00, $3F, $E0, $7F, $C0, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4BE0	DEFB $00, $00, $00, $00, $00, $0F, $FF, $80, $00, $00, $00, $07, $FC, $00, $00, $00, $00, $FF, $FF, $FF, $F0, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00

;L4C00	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4C20	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FF, $C0, $00, $03, $FF, $FF, $F8, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4C40	DEFB $00, $00, $00, $00, $00, $00, $00, $01, $FE, $00, $7F, $80, $00, $3F, $C0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4C60	DEFB $00, $00, $00, $00, $00, $00, $00, $03, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $3F, $C0, $00, $0F, $FF, $C0, $00, $0F, $F0, $00, $00, $00, $00, $00
;L4C80	DEFB $00, $00, $00, $00, $00, $00, $7F, $FF, $FC, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $0F, $F8, $00, $0F, $F0, $FF, $E0, $0F, $F0, $00, $00, $00, $00, $00
;L4CA0	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $07, $F9, $FE, $00, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4CC0	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FF, $F8, $00, $1F, $FF, $FF, $FF, $00, $00, $00, $3F, $FF, $FF, $C0, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4CE0	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00

;L4D00	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4D20	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FF, $E0, $00, $07, $FF, $FF, $FC, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4D40	DEFB $00, $00, $00, $00, $00, $00, $00, $01, $FE, $00, $7F, $80, $00, $3F, $C0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4D60	DEFB $00, $00, $00, $00, $00, $00, $00, $0F, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $3F, $C0, $00, $0F, $FF, $F0, $00, $0F, $F0, $00, $00, $00, $00, $00
;L4D80	DEFB $00, $00, $00, $00, $00, $00, $7F, $FF, $FC, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $07, $F8, $00, $0F, $F0, $3F, $E0, $0F, $F0, $00, $00, $00, $00, $00
;L4DA0	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $0F, $F9, $FF, $00, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4DC0	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FF, $F0, $00, $0F, $FF, $FF, $FE, $00, $00, $00, $3F, $FF, $FF, $C0, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4DE0	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00

;L4E00	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4E20	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FF, $F0, $00, $0F, $FF, $FF, $FE, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4E40	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4E60	DEFB $00, $00, $00, $00, $00, $00, $7F, $FF, $FC, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $3F, $E0, $00, $0F, $FF, $FC, $00, $0F, $F0, $00, $00, $00, $00, $00
;L4E80	DEFB $00, $00, $00, $00, $00, $00, $00, $0F, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $07, $F8, $00, $0F, $F0, $1F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4EA0	DEFB $00, $00, $00, $00, $00, $00, $00, $01, $FE, $00, $7F, $80, $00, $3F, $C0, $00, $00, $0F, $F0, $FF, $00, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4EC0	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FF, $E0, $00, $07, $FF, $FF, $FC, $00, $00, $00, $7F, $FF, $FF, $E0, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4EE0	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00

;L4F00	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4F20	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FF, $F8, $00, $1F, $FF, $FF, $FF, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4F40	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L4F60	DEFB $00, $00, $00, $00, $00, $00, $7F, $FF, $FC, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $1F, $E0, $00, $0F, $FF, $FE, $00, $0F, $F0, $00, $00, $00, $00, $00
;L4F80	DEFB $00, $00, $00, $00, $00, $00, $00, $03, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $07, $FC, $00, $0F, $F0, $1F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4FA0	DEFB $00, $00, $00, $00, $00, $00, $00, $01, $FE, $00, $7F, $80, $00, $3F, $C0, $00, $00, $0F, $F0, $FF, $00, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4FC0	DEFB $00, $00, $00, $00, $00, $0F, $FF, $FF, $C0, $00, $03, $FF, $FF, $F8, $00, $00, $00, $7F, $FF, $FF, $E0, $0F, $F0, $0F, $F0, $0F, $F0, $00, $00, $00, $00, $00
;L4FE0	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00

;	---------------------------------------------------- COMPRESSED SERIAL DATA  - logo in bottom 1/3------------------------------------------------------------------

;L5000	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5025	DEFB $0F, $FF, $80, $00, $00, $00, $07, $FC, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5045	DEFB $00, $01, $FF, $F8, $00, $1F, $FC, $07, $FF, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5065	DEFB $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5085	DEFB $00, $7F, $FF, $F8, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $1F, $E0, $00, $0F, $FF, $FF, $00, $0F, $F0
L50A5	DEFB $00, $00, $01, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $03, $FC, $00, $0F, $F0, $0F, $F0, $0F, $F0
L50C5	DEFB $00, $00, $03, $FE, $00, $7F, $C0, $00, $7F, $C0, $00, $00, $1F, $F0, $FF, $80, $0F, $F0, $0F, $F0, $0F, $F0
L50E5	DEFB $0F, $FF, $FF, $80, $00, $01, $FF, $FF, $F0, $00, $00, $00, $7F, $FF, $FF, $E0, $0F, $F0, $0F, $F0, $0F, $F0

;L5100	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5125	DEFB $0F, $FF, $F8, $00, $00, $00, $1F, $FF, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5145	DEFB $00, $00, $1F, $FC, $00, $3F, $F0, $01, $FF, $80, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5165	DEFB $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5185	DEFB $00, $7F, $FF, $F0, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $1F, $F0, $00, $0F, $FF, $FF, $80, $0F, $F0
L51A5	DEFB $00, $00, $01, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $03, $FC, $00, $0F, $F0, $0F, $F0, $0F, $F0
L51C5	DEFB $00, $00, $07, $FC, $00, $3F, $E0, $00, $FF, $80, $00, $00, $1F, $E0, $7F, $80, $0F, $F0, $0F, $F0, $0F, $F0
L51E5	DEFB $0F, $FF, $FE, $00, $00, $00, $7F, $FF, $C0, $00, $00, $00, $FF, $FF, $FF, $F0, $0F, $F0, $0F, $F0, $0F, $F0

;L5200	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5225	DEFB $0F, $FF, $FE, $00, $00, $00, $7F, $FF, $C0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5245	DEFB $00, $00, $07, $FC, $00, $3F, $E0, $00, $FF, $80, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5265	DEFB $00, $00, $01, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5285	DEFB $00, $7F, $FF, $F0, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $0F, $F0, $00, $0F, $FF, $FF, $C0, $0F, $F0
L52A5	DEFB $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $07, $FF, $FE, $00, $0F, $F0, $0F, $F0, $0F, $F0
L52C5	DEFB $00, $00, $1F, $FC, $00, $3F, $F0, $01, $FF, $80, $00, $00, $1F, $E0, $7F, $80, $0F, $F0, $0F, $F0, $0F, $F0
L52E5	DEFB $0F, $FF, $F8, $00, $00, $00, $1F, $FF, $00, $00, $00, $00, $FF, $FF, $FF, $F0, $0F, $F0, $0F, $F0, $0F, $F0

;L5300	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5325	DEFB $0F, $FF, $FF, $80, $00, $01, $FF, $FF, $F0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5345	DEFB $00, $00, $03, $FE, $00, $7F, $C0, $00, $7F, $C0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5365	DEFB $00, $00, $01, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5385	DEFB $00, $7F, $FF, $F8, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $0F, $F0, $00, $0F, $FF, $FF, $C0, $0F, $F0
L53A5	DEFB $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $07, $F9, $FE, $00, $0F, $F0, $0F, $F0, $0F, $F0
L53C5	DEFB $00, $01, $FF, $F8, $00, $1F, $FC, $07, $FF, $00, $00, $00, $3F, $E0, $7F, $C0, $0F, $F0, $0F, $F0, $0F, $F0
L53E5	DEFB $0F, $FF, $80, $00, $00, $00, $07, $FC, $00, $00, $00, $00, $FF, $FF, $FF, $F0, $0F, $F0, $0F, $F0, $0F, $F0

;L5400	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5425	DEFB $0F, $FF, $FF, $C0, $00, $03, $FF, $FF, $F8, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5445	DEFB $00, $00, $01, $FE, $00, $7F, $80, $00, $3F, $C0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5465	DEFB $00, $00, $03, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $3F, $C0, $00, $0F, $FF, $C0, $00, $0F, $F0
L5485	DEFB $00, $7F, $FF, $FC, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $0F, $F8, $00, $0F, $F0, $FF, $E0, $0F, $F0
L54A5	DEFB $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $07, $F9, $FE, $00, $0F, $F0, $0F, $F0, $0F, $F0
L54C5	DEFB $0F, $FF, $FF, $F8, $00, $1F, $FF, $FF, $FF, $00, $00, $00, $3F, $FF, $FF, $C0, $0F, $F0, $0F, $F0, $0F, $F0
L54E5	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00

;L5500	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5525	DEFB $0F, $FF, $FF, $E0, $00, $07, $FF, $FF, $FC, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5545	DEFB $00, $00, $01, $FE, $00, $7F, $80, $00, $3F, $C0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5565	DEFB $00, $00, $0F, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $3F, $C0, $00, $0F, $FF, $F0, $00, $0F, $F0
L5585	DEFB $00, $7F, $FF, $FC, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $07, $F8, $00, $0F, $F0, $3F, $E0, $0F, $F0
L55A5	DEFB $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $0F, $F9, $FF, $00, $0F, $F0, $0F, $F0, $0F, $F0
L55C5	DEFB $0F, $FF, $FF, $F0, $00, $0F, $FF, $FF, $FE, $00, $00, $00, $3F, $FF, $FF, $C0, $0F, $F0, $0F, $F0, $0F, $F0
L55E5	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00

;L5600	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5625	DEFB $0F, $FF, $FF, $F0, $00, $0F, $FF, $FF, $FE, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5645	DEFB $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5665	DEFB $00, $7F, $FF, $FC, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $3F, $E0, $00, $0F, $FF, $FC, $00, $0F, $F0
L5685	DEFB $00, $00, $0F, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $07, $F8, $00, $0F, $F0, $1F, $F0, $0F, $F0
L56A5	DEFB $00, $00, $01, $FE, $00, $7F, $80, $00, $3F, $C0, $00, $00, $0F, $F0, $FF, $00, $0F, $F0, $0F, $F0, $0F, $F0
L56C5	DEFB $0F, $FF, $FF, $E0, $00, $07, $FF, $FF, $FC, $00, $00, $00, $7F, $FF, $FF, $E0, $0F, $F0, $0F, $F0, $0F, $F0
L56E5	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00

;L5700	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5725	DEFB $0F, $FF, $FF, $F8, $00, $1F, $FF, $FF, $FF, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5745	DEFB $00, $00, $00, $FF, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
L5765	DEFB $00, $7F, $FF, $FC, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $1F, $E0, $00, $0F, $FF, $FE, $00, $0F, $F0
L5785	DEFB $00, $00, $03, $FE, $00, $FF, $00, $00, $1F, $E0, $00, $00, $00, $07, $FC, $00, $0F, $F0, $1F, $F0, $0F, $F0
L57A5	DEFB $00, $00, $01, $FE, $00, $7F, $80, $00, $3F, $C0, $00, $00, $0F, $F0, $FF, $00, $0F, $F0, $0F, $F0, $0F, $F0
L57C5	DEFB $0F, $FF, $FF, $C0, $00, $03, $FF, $FF, $F8, $00, $00, $00, $7F, $FF, $FF, $E0, $0F, $F0, $0F, $F0, $0F, $F0
L57E5	DEFB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00

;	===================================================================== end of 2/3  =================================================================================

;	------------- VIDEO ATTR FOR ANNIVERSARY GRAPHIC BLOCK - generated with SPECTRA Image Converter.exe from PNG drawn manually - logo in middle 1/3 ------------

;	===========================================================================  2/3  =================================================================================
;	successfully replaced by algorithm
;L5900	DEFB $00, $00, $00, $00, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L5920	DEFB $00, $00, $00, $00, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L5940	DEFB $00, $00, $00, $00, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;L5960	DEFB $00, $00, $00, $00, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $00, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $00, $00, $00, $00, $00
;L5980	DEFB $00, $00, $00, $00, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $00, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $00, $00, $00, $00, $00
;L59A0	DEFB $00, $00, $00, $00, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $00, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $00, $00, $00, $00, $00
;L59C0	DEFB $00, $00, $00, $00, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $00, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $00, $00, $00, $00, $00
;L59E0	DEFB $00, $00, $00, $00, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $00, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $00, $00, $00, $00, $00

;	===================================================================== end of 2/3  =================================================================================

			; ############ END OF ANNIVERSARY GRAPHIC BLOCK #############

M_20	DEFM	"ITC BRASOV - 1986-2016"
	DEFB	0
M_21	DEFM	"30 ANI DE LA PROIECTAREA COBRA"
	DEFB	0
M_31	DEFM	"DE CATRE O ECHIPA FORMATA DIN:"
	DEFB	0

M_22	DEFM	"GHEORGHE TOACSE"
	DEFB	0

M_23	DEFM	" VASILE PRODAN  "
	DEFB	0
M_24	DEFM	" WAGNER BERND   "
	DEFB	0
M_25	DEFM	" SORIN FINICHIU "
	DEFB	0
M_26	DEFM	" MIRCEA UNGUR   "
	DEFB	0

M_27	DEFM	" MARCEL AREFTA  "
	DEFB	0
M_28	DEFM	" MIRCEA POP     "
	DEFB	0
M_29	DEFM	" SORIN CISMAS   "
	DEFB	0
M_30	DEFM	" ALEXANDRU ANTAL"
	DEFB	0

FLASH	DEFB	$41,$42,$43,$44,$45,$46,$47,$46,$45,$44,$43,$42

	; ########## TABLE HOLDING STAR POSITIONS (ROW/COL) & COLOR ATTR ADDRESSES (ATTR NOT STORED ANYMORE, NOW CALCULATED) ##########

P01	DEFW	$0000		; attr at $5800
;AT01	DEFW	$5800

P02	DEFW	$0200		; attr at $5840
;AT02	DEFW	$5840
P03	DEFW	$0101		; attr at $5821
;AT03	DEFW	$5821
P04	DEFW	$0002		; attr at $5802
;AT04	DEFW	$5802

P05	DEFW	$0400		; attr at $5880
;AT05	DEFW	$5880
P06	DEFW	$0301		; attr at $5861
;AT06	DEFW	$5861

P07	DEFW	$0600		; attr at $58C0
;AT07	DEFW	$58C0
P08	DEFW	$0501		; attr at $58A1
;AT08	DEFW	$58A1
;;P09	DEFW	$0303		; attr at $5863		; moved
;;AT09	DEFW	$5863					;

P10	DEFW	$0800		; attr at $5900
;AT10	DEFW	$5900
P11	DEFW	$0701		; attr at $5801
;AT11	DEFW	$58E1
P09	DEFW	$0404		; attr at $5863
;AT09	DEFW	$5884
P12	DEFW	$0305		; attr at $5865
;AT12	DEFW	$5865

P13	DEFW	$0A00		; attr at $5940
;AT13	DEFW	$5940
P14	DEFW	$0901		; attr at $5921
;AT14	DEFW	$5921
P15	DEFW	$0802		; attr at $5902
;AT15	DEFW	$5902
P46	DEFW	$0505		; attr at $58A5
;AT46	DEFW	$58A5

P16	DEFW	$0C00		; attr at $5980
;AT16	DEFW	$5980
P17	DEFW	$0B01		; attr at $5961
;AT17	DEFW	$5961
P18	DEFW	$0A02		; attr at $5942
;AT18	DEFW	$5942
P19	DEFW	$0903		; attr at $5923
;AT19	DEFW	$5923
P101	DEFW	$0507		; attr at $58A7
;AT101	DEFW	$58A7
P20	DEFW	$010B		; attr at $582B
;AT20	DEFW	$582B
P21	DEFW	$000C		; attr at $580C
;AT21	DEFW	$580C

P22	DEFW	$0E00		; attr at $59C0
;AT22	DEFW	$59C0
P23	DEFW	$0D01		; attr at $59A1
;AT23	DEFW	$59A1
P24	DEFW	$0C02		; attr at $5982
;AT24	DEFW	$5982
P25	DEFW	$0B03		; attr at $5963
;AT25	DEFW	$5963
P102	DEFW	$0509		; attr at $58A9
;AT102	DEFW	$58A9
P103	DEFW	$040A		; attr at $588A
;AT103	DEFW	$588A
P26	DEFW	$020C		; attr at $584C
;AT26	DEFW	$584C
P27	DEFW	$010D		; attr at $582D
;AT27	DEFW	$582D
P28	DEFW	$000E		; attr at $580E
;AT28	DEFW	$580E

P29	DEFW	$0F01		; attr at $59E1
;AT29	DEFW	$59E1
P30	DEFW	$0E02		; attr at $59C2
;AT30	DEFW	$59C2
P31	DEFW	$0D03		; attr at $59A3
;AT31	DEFW	$59A3
P32	DEFW	$020E		; attr at $584E
;AT32	DEFW	$584E
P33	DEFW	$010F		; attr at $582F
;AT33	DEFW	$582F
P34	DEFW	$0010		; attr at $5810
;AT34	DEFW	$5810

P35	DEFW	$0F03		; attr at $59E3
;AT35	DEFW	$59E3
P36	DEFW	$0210		; attr at $5850
;AT36	DEFW	$5850
P37	DEFW	$0111		; attr at $5831
;AT37	DEFW	$5831
P38	DEFW	$0012		; attr at $5812
;AT38	DEFW	$5812

P39	DEFW	$0212		; attr at $5852
;AT39	DEFW	$5852
P40	DEFW	$0113		; attr at $5833
;AT40	DEFW	$5833
P41	DEFW	$0014		; attr at $5814
;AT41	DEFW	$5814

P42	DEFW	$080E		; attr at $590E
;AT42	DEFW	$590E
P43	DEFW	$0214		; attr at $5854
;AT43	DEFW	$5854
P44	DEFW	$0115		; attr at $5835
;AT44	DEFW	$5835
P45	DEFW	$0016		; attr at $5816
;AT45	DEFW	$5816

;;P46	DEFW	$0A0E		; attr at 	; moved
;;AT46	DEFW	$594E				;
P47	DEFW	$090F		; attr at $592F
;AT47	DEFW	$592F
P48	DEFW	$0810		; attr at $5910
;AT48	DEFW	$5910
P49	DEFW	$0216		; attr at $5856
;AT49	DEFW	$5856
P50	DEFW	$0117		; attr at $5837
;AT50	DEFW	$5837
P51	DEFW	$0018		; attr at $5818
;AT51	DEFW	$5818

P52	DEFW	$0A10		; attr at $5950
;AT52	DEFW	$5950
P53	DEFW	$0911		; attr at $5931
;AT53	DEFW	$5931
P54	DEFW	$0812		; attr at $5912
;AT54	DEFW	$5912
P55	DEFW	$0218		; attr at $5858
;AT55	DEFW	$5858
P56	DEFW	$0119		; attr at $5839
;AT56	DEFW	$5839
P57	DEFW	$001A		; attr at $581A
;AT57	DEFW	$581A

P58	DEFW	$0A12		; attr at $5952
;AT58	DEFW	$5952
P59	DEFW	$0913		; attr at $5933
;AT59	DEFW	$5933
P60	DEFW	$0814		; attr at $5914
;AT60	DEFW	$5914
P61	DEFW	$021A		; attr at $585A
;AT61	DEFW	$585A
P62	DEFW	$011B		; attr at $583B
;AT62	DEFW	$583B
P63	DEFW	$001C		; attr at $581C
;AT63	DEFW	$581C

P64	DEFW	$0A14		; attr at $5954
;AT64	DEFW	$5954
P65	DEFW	$0915		; attr at $5935
;AT65	DEFW	$5935
P66	DEFW	$0816		; attr at $5916
;AT66	DEFW	$5916
P67	DEFW	$021C		; attr at $585C
;AT67	DEFW	$585C
P68	DEFW	$011D		; attr at $583D
;AT68	DEFW	$583D
P69	DEFW	$001E		; attr at $581E
;AT69	DEFW	$581E

P70	DEFW	$0A16		; attr at $5956
;AT70	DEFW	$5956
P71	DEFW	$0917		; attr at $5937
;AT71	DEFW	$5937
P72	DEFW	$0818		; attr at $5918
;AT72	DEFW	$5918
P73	DEFW	$021E		; attr at $585E
;AT73	DEFW	$585E
P74	DEFW	$011F		; attr at $583F
;AT74	DEFW	$583F

P75	DEFW	$0A18		; attr at $5958
;AT75	DEFW	$5958
P76	DEFW	$0919		; attr at $5939
;AT76	DEFW	$5939
P77	DEFW	$081A		; attr at $591A
;AT77	DEFW	$591A
P78	DEFW	$041E		; attr at $589E
;AT78	DEFW	$589E
P79	DEFW	$031F		; attr at $587F
;AT79	DEFW	$587F

P80	DEFW	$0A1A		; attr at $595A
;AT80	DEFW	$595A
P81	DEFW	$091B		; attr at $593B
;AT81	DEFW	$593B
P82	DEFW	$081C		; attr at $591C
;AT82	DEFW	$591C
P83	DEFW	$061E		; attr at $59DE
;AT83	DEFW	$59DE
P84	DEFW	$051F		; attr at $58BF
;AT84	DEFW	$58BF

P85	DEFW	$0A1C		; attr at $595C
;AT85	DEFW	$595C
P86	DEFW	$091D		; attr at $593D
;AT86	DEFW	$593D
P87	DEFW	$081E		; attr at $591E
;AT87	DEFW	$591E
P88	DEFW	$071F		; attr at $58FF
;AT88	DEFW	$58FF

P89	DEFW	$0C1C		; attr at $599C
;AT89	DEFW	$599C
P90	DEFW	$0B1D		; attr at $597D
;AT90	DEFW	$597D
P91	DEFW	$0A1E		; attr at $595E
;AT91	DEFW	$595E
P92	DEFW	$091F		; attr at $593F
;AT92	DEFW	$593F

P93	DEFW	$0E1C		; attr at $59DC
;AT93	DEFW	$59DC
P94	DEFW	$0D1D		; attr at $59BD
;AT94	DEFW	$59BD
P95	DEFW	$0C1E		; attr at $599E
;AT95	DEFW	$599E
P96	DEFW	$0B1F		; attr at $597F
;AT96	DEFW	$597F

P97	DEFW	$0F1D		; attr at $59FD
;AT97	DEFW	$59FD
P98	DEFW	$0E1E		; attr at $59DE
;AT98	DEFW	$59DE
P99	DEFW	$0D1F		; attr at $59BF
;AT99	DEFW	$59BF

P100	DEFW	$0F1F		; attr at $59FF
;AT100	DEFW	$59FF